YAMP.ParseContext.RemoveConstant C# (CSharp) Method

RemoveConstant() public method

Removes a constant from the context.
public RemoveConstant ( String name ) : ParseContext
name String /// The name of the constant. ///
return ParseContext
        public ParseContext RemoveConstant(String name)
        {
            if (_constants.ContainsKey(name))
            {
                _constants.Remove(name);
            }

            return this;
        }

Usage Example

コード例 #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);
                }
            }
        }
All Usage Examples Of YAMP.ParseContext::RemoveConstant