public override void Initialise() { Settings = LoadSettings <PluginSettings>(); LogOutput("Loaded example settings"); NotALocalFunction = Substrate.GetSharedFunction <ForeignFunction>("PluginNamespace.PluginClass.FunctionName"); }
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); }
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); }
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); } }