RemoveFunction() public method

Removes a function from the context.
public RemoveFunction ( String name ) : ParseContext
name String /// The name of the function. ///
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 function using a specific context.
 /// </summary>
 /// <param name="context">
 /// The context where this function should be removed.
 /// </param>
 /// <param name="name">
 /// The name of the symbol corresponding to the function that should be removed.
 /// </param>
 /// <returns>The given context.</returns>
 public static ParseContext RemoveCustomFunction(ParseContext context, string name)
 {
     context.RemoveFunction(name);
     return(context);
 }