コード例 #1
0
        //defer is called during the execution of an IAction
        void IEngineScope <TModel> .Defer(IDeferredAction <TModel> action, bool onlyIfValidationsResolved)
        {
            string key = RunManager.GetDeferralId();

            if (onlyIfValidationsResolved)
            {
                this.finalize.Add(key, action);
            }
            else
            {
                this.finalizeAlways.Add(key, action);
            }
        }
コード例 #2
0
ファイル: PluginController.cs プロジェクト: EBassie/Potato
        /// <summary>
        /// Sets up and sends a deferred action to the server.
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        public virtual ICommandResult Action(IDeferredAction action) {
            ICommandResult result = null;

            if (action.GetAction() != null) {
                // Wait for responses from this action
                this.DeferredActions.TryAdd(action.GetAction().Uid, action);

                // Send the action for processing
                result = this.Action(action.GetAction());

                // Alert the deferred action of packets that have been sent
                action.TryInsertSent(action.GetAction(), result.Now.Packets);
            }

            // Now return the result 
            return result;
        }
コード例 #3
0
ファイル: DeferProxy.cs プロジェクト: mchnry/flow
 public DeferProxy(IDeferredAction <TSubModel> deferAction, IEngineScopeDefer <TSubModel> scope)
 {
     this.deferAction = deferAction;
     this.deferScope  = scope;
 }
コード例 #4
0
 private static void AddDeferredAction(IDeferredAction action)
 {
     DeferredActions.Add(action);
 }