Ejemplo n.º 1
0
 public virtual void AddExecutor(User user)
 {
     if (!user.IsExecutor)
     {
         throw new ApplicationException("Пользователь не является исполнителем");
     }
     Executors.Add(user);
 }
Ejemplo n.º 2
0
 protected override void InitExecutors()
 {
     Executors.Add("^search( \\S+)+$", args => Search(args));
     Executors.Add("^view doc (\\S+){1,50}$", args => ViewDoc(args));
     Executors.Add("^view doc (\\S+){1,50}( #all)$", args => ViewDoc(args));
     Executors.Add("^show help$", args => ShowHelp());
     Executors.Add("^exit$", args => Exit());
 }
Ejemplo n.º 3
0
 public AndQueryExecutor(IStorageEngine engine, AndQuery outerQuery)
 {
     Engine     = engine;
     OuterQuery = outerQuery;
     foreach (var query in outerQuery.Queries)
     {
         Executors.Add(query.GetExecutor(engine));
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Do the action for every card if no other Executor is added to it.
 /// </summary>
 public void AddExecutor(ExecutorType type)
 {
     Executors.Add(new CardExecutor(type, -1, DefaultNoExecutor));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Do the action for every card if func return true.
 /// </summary>
 public void AddExecutor(ExecutorType type, Func <bool> func)
 {
     Executors.Add(new CardExecutor(type, -1, func));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Do the action for the card if available.
 /// </summary>
 public void AddExecutor(ExecutorType type, int cardId)
 {
     Executors.Add(new CardExecutor(type, cardId, null));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Do the action for the card if func return true.
 /// </summary>
 public void AddExecutor(ExecutorType type, int cardId, Func <bool> func)
 {
     Executors.Add(new CardExecutor(type, cardId, func));
 }