RaiseVariableRemoved() 개인적인 메소드

This is raised when a variable has been removed.
private RaiseVariableRemoved ( VariableEventArgs e ) : void
e VariableEventArgs The variable arguments.
리턴 void
예제 #1
0
        /// <summary>
        /// Assigns a variable to the given context.
        /// </summary>
        /// <param name="context">The context, where to assign the variable to.</param>
        /// <param name="name">The name of the variable.</param>
        /// <param name="value">The value of the variable.</param>
        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);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Assigns a variable to the given context.
        /// </summary>
        /// <param name="context">The context, where to assign the variable to.</param>
        /// <param name="name">The name of the variable.</param>
        /// <param name="value">The value of the variable.</param>
        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);
                }
            }
        }