public CustomAction(string resourceKey, IBatchAlterModel model, Action<Term, TimeBox> action) { ResourceKey = resourceKey; AlterType = model.Category; Model = model; Action = action; }
public OptionalAction(string resourceKey, IBatchAlterModel model, ICustomAction[] options) { ResourceKey = resourceKey; AlterType = model.Category; Model = model; Options = options; SelectedItem = Options.FirstOrDefault(); }
public BatchDispatcherPresenter() { var args = new Dictionary<string, object> { { "watchPoint", base.GetWatchPoint() } }; AssignmentAlterModel = Container.Resolve<IAssignmentBatchAlterModel>(args); EventAlterModel = Container.Resolve<IEventBatchAlterModel>(args); AddingEventModel = Container.Resolve<IBatchAddingEventModel>(args); AddingShiftModel = Container.Resolve<IBatchAddingShiftModel>(args); Patterns = new IBatchAlterModel[] { AssignmentAlterModel, EventAlterModel, AddingEventModel, AddingShiftModel }; }
public void Apply(IBatchAlterModel model, ObservableCollection<object> optinalActions) { if (_dispatchDelegate != null) _dispatchDelegate(model, optinalActions); }
private void TryDispatch(IBatchAlterModel model, Func<Term, bool> filter, Action<Term, TimeBox> action) { var applied = false; model.OnDispatching(); var agents = GetSelectedAgents(true); foreach (IAgent item in agents) { var agent = item; model.TryDispatch(agent, filter, action, (t, text, success) => { if (success) { t.SaftyInvoke<Term>(x => x.Tag = _comments); applied = true; } agent.OperationFail = !success; }); } if (RefreshDelegate != null) RefreshDelegate.Invoke(agents, applied); }
public void InsertAssignment(IBatchAlterModel model) { TryDispatch(model, t => true, (t, tb) => { }); }
public CustomFilter(string resourceKey, IBatchAlterModel model, Func<Term, bool> whereClause) { ResourceKey = resourceKey; Model = model; WhereClause = whereClause; }