Contains information about which variable changed its value into what.
Inheritance: System.EventArgs
コード例 #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>
 /// This is raised when a variable has been removed.
 /// </summary>
 /// <param name="e">The variable arguments.</param>
 internal void RaiseVariableRemoved(VariableEventArgs e)
 {
     if (VariableRemoved != null)
     {
         VariableRemoved(this, e);
     }
 }
コード例 #3
0
 /// <summary>
 /// This is raised when a variable has been removed.
 /// </summary>
 /// <param name="name">The name of the variable.</param>
 /// <param name="value">The value of the variable.</param>
 internal void RaiseVariableRemoved(string name, Value value)
 {
     if (OnVariableRemoved != null)
     {
         var args = new VariableEventArgs(name, value);
         OnVariableRemoved(this, args);
     }
 }
コード例 #4
0
        /// <summary>
        /// Clears the list of assigned variables.
        /// </summary>
        public ParseContext Clear()
        {
            foreach (var pair in _variables)
            {
                var e = new VariableEventArgs(pair.Key, pair.Value);
                RaiseVariableRemoved(e);
            }

            _variables.Clear();
            return(this);
        }
コード例 #5
0
ファイル: ParseContext.cs プロジェクト: FlorianRappl/YAMP
        /// <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);
                }
            }
        }
コード例 #6
0
ファイル: ParseContext.cs プロジェクト: FlorianRappl/YAMP
 /// <summary>
 /// This is raised when a variable has been removed.
 /// </summary>
 /// <param name="e">The variable arguments.</param>
 internal void RaiseVariableRemoved(VariableEventArgs e)
 {
     if (VariableRemoved != null)
     {
         VariableRemoved(this, e);
     }
 }
コード例 #7
0
ファイル: ParseContext.cs プロジェクト: FlorianRappl/YAMP
        /// <summary>
        /// Clears the list of assigned variables.
        /// </summary>
        public ParseContext Clear()
        {
            foreach (var pair in _variables)
            {
                var e = new VariableEventArgs(pair.Key, pair.Value);
                RaiseVariableRemoved(e);
            }

            _variables.Clear();
            return this;
        }