YAMP.ParseContext.AssignVariable C# (CSharp) Method

AssignVariable() static private method

Assigns a variable to the given context.
static private AssignVariable ( ParseContext context, String name, Value value ) : void
context ParseContext The context, where to assign the variable to.
name String The name of the variable.
value Value The value of the variable.
return void
        static void AssignVariable(ParseContext context, String name, Value value)
        {
            var e = new VariableEventArgs(name, value);

            if (value != null)
            {
                if (context._variables.ContainsKey(name))
                {
                    context._variables[name] = value;
                    context.RaiseVariableChanged(e);
                }
                else
                {
                    context._variables.Add(name, value);
                    context.RaiseVariableCreated(e);
                }
            }
            else
            {
                if (context._variables.ContainsKey(name))
                {
                    context._variables.Remove(name);
                    context.RaiseVariableRemoved(e);
                }
            }
        }

Same methods

ParseContext::AssignVariable ( String name, Value value ) : ParseContext