RemoveConstant() public method

Removes a constant from the context.
public RemoveConstant ( String name ) : ParseContext
name String /// The name of the constant. ///
return ParseContext
Ejemplo n.º 1
0
        /// <summary>
        /// Uninstalls the plugin.
        /// </summary>
        public void Uninstall()
        {
            foreach (var function in _functions)
            {
                _context.RemoveFunction(function);
            }

            foreach (var constant in _constants)
            {
                _context.RemoveConstant(constant);
            }

            foreach (var valueType in _valueTypes)
            {
                var trash = new List <String>();

                foreach (var variable in _context.Variables)
                {
                    if (variable.Value.Header == valueType)
                    {
                        trash.Add(variable.Key);
                    }
                }

                foreach (var entry in trash)
                {
                    _context.Variables.Remove(entry);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes a custom constant using a specific context.
 /// </summary>
 /// <param name="context">
 /// The context where this constant should be removed.
 /// </param>
 /// <param name="name">
 /// The name of the symbol corresponding to the constant that should be removed.
 /// </param>
 /// <returns>The given context.</returns>
 public static ParseContext RemoveCustomConstant(ParseContext context, string name)
 {
     context.RemoveConstant(name);
     return(context);
 }