X Tutup
Skip to content

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

@ttdat2232

Description

@ttdat2232

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FastAGIIssue specific to AGI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup