Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Pass object of abstract class AGIScript instead create script at runtime #281

Copy link
Copy link

Description

@ttdat2232
Issue body actions

If I understand correctly, a class which implements abstract class AGIScript will be created at runtime via Reflection.

this is the code in GeneralMappingStrategy.cs uses reflection to create script object:

public AGIScript CreateInstance()
        {
            AGIScript rtn = null;
            try
            {
                if (LoadedAssembly != null)
                    rtn = (AGIScript)LoadedAssembly.CreateInstance(ClassName);
                else
                    rtn = (AGIScript)Assembly.GetEntryAssembly().CreateInstance(ClassName);
            }
            catch (Exception ex)
            {

            }
            return rtn;
        }

I want to create a script object by myself or use dependency injection technique, because my script class can be depended on another dependencies.
Is it possible?

Thanks in advanced.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    FastAGIIssue specific to AGI.Issue specific to AGI.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.