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

Sets Item: variable or type
public SetItem ( string id, object value ) : void
id string item's id
value object value
Результат void
Пример #1
0
        private void SetBaseItems(ScriptScope result)
        {
            //Process only root scopes
            if (result.Parent != null)
            {
                return;
            }

            //Variables
            result.SetItem("Scope", this);
            result.SetItem("Compiler", ScriptdotnetGrammar.Compiler);

            ////Custom Functions
            //AppendAst
            result.SetItem(ScriptNET.CustomFunctions.AppendFunc.FunctionName, ScriptNET.CustomFunctions.AppendFunc.FunctionDefinition);
            //ReplaceAst
            result.SetItem(ScriptNET.CustomFunctions.ReplaceFunc.FunctionName, ScriptNET.CustomFunctions.ReplaceFunc.FunctionDefinition);
            //eval
            result.SetItem(ScriptNET.CustomFunctions.EvalFunc.FunctionName, ScriptNET.CustomFunctions.EvalFunc.FunctionDefinition);
            //About
            result.SetItem(ScriptNET.CustomFunctions.AboutFunc.FunctionName, ScriptNET.CustomFunctions.AboutFunc.FunctionDefinition);
            //Console
            result.SetItem(ScriptNET.CustomFunctions.RunConsole.FunctionName, ScriptNET.CustomFunctions.RunConsole.FunctionDefinition);
            //Array
            result.SetItem(ScriptNET.CustomFunctions.ArrayFunc.FunctionName, ScriptNET.CustomFunctions.ArrayFunc.FunctionDefinition);
            //Char
            result.SetItem(ScriptNET.CustomFunctions.CharFunc.FunctionName, ScriptNET.CustomFunctions.CharFunc.FunctionDefinition);
        }
Пример #2
0
        private void SetBaseItems(ScriptScope result)
        {
            //Process only root scopes
              if (result.Parent != null) return;

              //Variables
              result.SetItem("Scope", this);
              result.SetItem("Compiler", ScriptdotnetGrammar.Compiler);

              ////Custom Functions
              //AppendAst
              result.SetItem(ScriptNET.CustomFunctions.AppendFunc.FunctionName, ScriptNET.CustomFunctions.AppendFunc.FunctionDefinition);
              //ReplaceAst
              result.SetItem(ScriptNET.CustomFunctions.ReplaceFunc.FunctionName, ScriptNET.CustomFunctions.ReplaceFunc.FunctionDefinition);
              //eval
              result.SetItem(ScriptNET.CustomFunctions.EvalFunc.FunctionName, ScriptNET.CustomFunctions.EvalFunc.FunctionDefinition);
              //About
              result.SetItem(ScriptNET.CustomFunctions.AboutFunc.FunctionName, ScriptNET.CustomFunctions.AboutFunc.FunctionDefinition);
              //Console
              result.SetItem(ScriptNET.CustomFunctions.RunConsole.FunctionName, ScriptNET.CustomFunctions.RunConsole.FunctionDefinition);
              //Array
              result.SetItem(ScriptNET.CustomFunctions.ArrayFunc.FunctionName, ScriptNET.CustomFunctions.ArrayFunc.FunctionDefinition);
              //Char
              result.SetItem(ScriptNET.CustomFunctions.CharFunc.FunctionName, ScriptNET.CustomFunctions.CharFunc.FunctionDefinition);
        }