public virtual void AddExecutor(User user) { if (!user.IsExecutor) { throw new ApplicationException("Пользователь не является исполнителем"); } Executors.Add(user); }
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()); }
public AndQueryExecutor(IStorageEngine engine, AndQuery outerQuery) { Engine = engine; OuterQuery = outerQuery; foreach (var query in outerQuery.Queries) { Executors.Add(query.GetExecutor(engine)); } }
/// <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)); }
/// <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)); }
/// <summary> /// Do the action for the card if available. /// </summary> public void AddExecutor(ExecutorType type, int cardId) { Executors.Add(new CardExecutor(type, cardId, null)); }
/// <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)); }