CSScriptEvaluatorApi.HostApp.EvaluatorSamples.LoadDelegate C# (CSharp) Метод

LoadDelegate() публичный Метод

public LoadDelegate ( ) : void
Результат void
            public void LoadDelegate()
            {
                // Wraps method into a class definition, loads the compiled assembly
                // and returns the method delegate for the method, which matches the delegate specified
                // as the type parameter of LoadDelegate

                var product = CSScript.Evaluator
                                      .LoadDelegate<Func<int, int, int>>(
                                                  @"int Product(int a, int b)
                                                    {
                                                        return a * b;
                                                    }");

                int result = product(3, 2);
            }