public override void Initialise()
        {
            Settings = LoadSettings <PluginSettings>();
            LogOutput("Loaded example settings");

            NotALocalFunction = Substrate.GetSharedFunction <ForeignFunction>("PluginNamespace.PluginClass.FunctionName");
        }
Beispiel #2
0
        protected void Add(string name, IBoundDecl arg, IBoundDecl returnType, Func<Value[], Value> func)
        {
            int id = mFunctions.Count;

            var foreignFunction = new ForeignFunction(name, id, arg, returnType);
            mFunctions[id] = new KeyValuePair<ForeignFunction, Func<Value[], Value>>(foreignFunction, func);
        }
Beispiel #3
0
        protected void Add(string name, IBoundDecl arg, IBoundDecl returnType, Func <Value[], Value> func)
        {
            int id = mFunctions.Count;

            var foreignFunction = new ForeignFunction(name, id, arg, returnType);

            mFunctions[id] = new KeyValuePair <ForeignFunction, Func <Value[], Value> >(foreignFunction, func);
        }
Beispiel #4
0
 public void RegisterForeignFunction(string category, string name, ForeignFunction function, IntPtr userData)
 {
     VlScriptHeader.VlsForeignFunction foreignFunction = new VlScriptHeader.VlsForeignFunction(function);
     if (VlScriptHeader.VlsRegisterForeignFunction(host, category, name,
                                                   foreignFunction,
                                                   userData) == VlScriptHeader.VLS_ERR)
     {
         RaiseException();
     }
     else
     {
         this.registeredForeignFunctions.Add(foreignFunction);
     }
 }