예제 #1
0
 /// <summary>
 /// Adds new command metadata
 /// </summary>
 /// <param name="metadata"></param>
 public void AddMetadata(CommandMetadata metadata)
 {
     ThrowIfDisposed();
     //Lock to add to metadata so that we don't modify the collection while it's being
     //iterated on another thread
     lock (_lock)
     {
         _metadata.Add(metadata);
     }
 }
예제 #2
0
 /// <summary>
 /// Returns an instance of the parser that is currently registered.
 /// </summary>
 /// <param name="registry">Registry to be used by the parser</param>
 /// <param name="input">String input provided to the parser</param>
 /// <param name="args">Additional arguments to be used by the parser</param>
 /// <param name="metadata">Metadata to be used by the parser</param>
 /// <param name="exeData">CommandExecutorData to be used by the parser</param>
 /// <param name="ctx">Context to be used by the parser</param>
 /// <param name="callback">Callback method to be invoked when the parser completes</param>
 public AbstractParser GetParser(CommandRegistry registry,
                                 string input,
                                 IEnumerable <object> args,
                                 CommandMetadata metadata,
                                 CommandExecutorData exeData,
                                 IContextObject ctx,
                                 InputResultDelegate callback)
 {
     ThrowIfDisposed();
     return((AbstractParser)Activator.CreateInstance(_parser, registry, input, args, metadata, exeData, ctx, callback));
 }