コード例 #1
0
ファイル: OptionalAction.cs プロジェクト: Mrding/Ribbon
        public CustomAction(string resourceKey, IBatchAlterModel model, Action<Term, TimeBox> action)
        {
            ResourceKey = resourceKey;
            AlterType = model.Category;

            Model = model;
            Action = action;
        }
コード例 #2
0
ファイル: OptionalAction.cs プロジェクト: Mrding/Ribbon
 public OptionalAction(string resourceKey, IBatchAlterModel model, ICustomAction[] options)
 {
     ResourceKey = resourceKey; 
     AlterType = model.Category;
     Model = model;
     Options = options;
     SelectedItem = Options.FirstOrDefault();
 }
コード例 #3
0
        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
                                              };
        }
コード例 #4
0
 public void Apply(IBatchAlterModel model, ObservableCollection<object> optinalActions)
 {
     if (_dispatchDelegate != null)
         _dispatchDelegate(model, optinalActions);
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 public void InsertAssignment(IBatchAlterModel model)
 {
     TryDispatch(model, t => true, (t, tb) => { });
 }
コード例 #7
0
ファイル: CustomFilter.cs プロジェクト: Mrding/Ribbon
 public CustomFilter(string resourceKey, IBatchAlterModel model, Func<Term, bool> whereClause)
 {
     ResourceKey = resourceKey;
     Model = model;
     WhereClause = whereClause;
 }
コード例 #8
0
 public void InsertAssignment(IBatchAlterModel model)
 {
     TryDispatch(model, t => true, (t, tb) => { });
 }