Esempio n. 1
0
 public override void Init(IScriptExportManager manager)
 {
     m_declaringType = manager.RetrieveType(Method.DeclaringType);
     m_returnType    = manager.RetrieveType(Method.ReturnType);
     m_parameters    = new ScriptExportParameter[Method.Parameters.Count];
     for (int i = 0; i < m_parameters.Length; i++)
     {
         ParameterDefinition argument = Method.Parameters[i];
         m_parameters[i] = manager.RetrieveParameter(argument);
     }
 }
Esempio n. 2
0
 private IReadOnlyList <ScriptExportParameter> CreateParameterTypes(IScriptExportManager manager)
 {
     foreach (MethodDefinition method in Type.Methods)
     {
         if (method.Name == InvokeMethodName)
         {
             ScriptExportParameter[] parameters = new ScriptExportParameter[method.Parameters.Count];
             for (int i = 0; i < parameters.Length; i++)
             {
                 parameters[i] = manager.RetrieveParameter(method.Parameters[i]);
             }
             return(parameters);
         }
     }
     throw new Exception($"Invoke method '{InvokeMethodName}' wasn't found");
 }