CSScriptNativeApi.HostApp.CodeDomSamples.LoadMethod_Instance C# (CSharp) Метод

LoadMethod_Instance() публичный статический Метод

public static LoadMethod_Instance ( ) : void
Результат void
            public static void LoadMethod_Instance()
            {
                // 1- LoadMethod wraps method into a class definition, compiles it and returns loaded assembly
                // 2 - CreateObject creates instance of a first class in the assembly  

                dynamic script = CSScript.LoadMethod(@"int Sqr(int data)
                                                       {
                                                           return data * data;
                                                       }")
                                         .CreateObject("*");

                var result = script.Sqr(7);
            }