RaiseVariableChanged() private méthode

This is raised when a variable has changed.
private RaiseVariableChanged ( VariableEventArgs e ) : void
e VariableEventArgs The variable arguments.
Résultat void
Exemple #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);
                }
            }
        }
Exemple #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);
                }
            }
        }