当前位置: 首页>>代码示例>>C#>>正文


C# IAction.Execute方法代码示例

本文整理汇总了C#中IAction.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# IAction.Execute方法的具体用法?C# IAction.Execute怎么用?C# IAction.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAction的用法示例。


在下文中一共展示了IAction.Execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        protected void Execute(IAction action)
        {
            var signal = new ManualResetEvent(false);

            action.Completed += (sender, e) => signal.Set();
            action.Execute();

            signal.WaitOne();
        }
开发者ID:yevhen,项目名称:Servelat-Pieces,代码行数:9,代码来源:ContextSpecification.cs

示例2: CommitAction

        public void CommitAction(IAction action)
        {
            action.Execute();

            undoStack.Push(action);
            FireUndoStackDepthChanged();

            redoStack.Clear();
            FireRedoStackDepthChanged();

            DirtyFlag = true;
        }
开发者ID:jdmclark,项目名称:nullunit,代码行数:12,代码来源:AbstractDocument.cs

示例3: Execution

 private void Execution(IAction hAction)
 {
     try
     {
         hAction.Execute(m_hService, m_hContext);
     }
     catch (Exception hEx)
     {
         //Todo: error handling, creare un handler con una coda concorrente e accodare xche possono arrivare sia da piu thread contemporaneamente
         Console.WriteLine("Error Executing Action " + hEx);
     }
     finally
     {
         (hAction as Packet).Recycle();
     }
 }
开发者ID:Alx666,项目名称:Netbase,代码行数:16,代码来源:ServingModeParallel.cs

示例4: Execute

        /// <summary>
        /// Run the Execute() method of the IAction
        /// </summary>
        /// <param name="wTestObject"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public IAction Execute(WTest wTestObject, IAction action)
        {
            try
            {
                // execute the action
                action.Execute();

                // get the results from the action
                wTestObject.Success = action.Success;
                wTestObject.Message = action.PostActionMessage;
            }
            catch (Exception ex)
            {
                wTestObject.Success = false;
                wTestObject.Message = ex.Message;
                if (ex.InnerException != null)
                {
                    wTestObject.Message += ": " + ex.InnerException.Message;
                }
            }
            return action;
        }
开发者ID:yorkshiretwist,项目名称:WTester,代码行数:28,代码来源:ActionInvoker.cs

示例5: DoPlayerAction

        public IEnumerable<FightStep> DoPlayerAction(IAction action)
        {
            foreach (FightStep step in action.Execute(game, Player, Enemy))
            {
                yield return step;
            }
            if (surpriseAttack)
            {
                surpriseAttack = false;
                yield break;
            }
            // Wizards get +1 HP per turn during battle
            if (Player.Class.Type == ClassType.WIZARD)
            {
                Player.UpdateHitPoints(1);
                yield return new HealStep(Player, 1, Player.HitPoints);
            }

            if (!isPlayerFirst)
            {
                EndOfRound();
            }

            if (Enemy.IsDead())
            {
                yield break;
            }

            if (IsInProgress())
            {
                foreach (FightStep step in DoEnemyTurn())
                {
                    yield return step;
                }
            }
        }
开发者ID:jennstubley,项目名称:rpg-game,代码行数:36,代码来源:Fight.cs

示例6: Execute

 public static void Execute(IAction instance)
 {
     //instance.Logger = UIManager.Logger;
     instance.Execute();
 }
开发者ID:fernandolucasrodriguez,项目名称:qit,代码行数:5,代码来源:FactoryAction.cs

示例7: RecordAction

 public void RecordAction(IAction existingAction)
 {
     if (existingAction != null)
     {
         CheckNotRunningBeforeRecording(existingAction);
         if (ExecuteImmediatelyWithoutRecording && existingAction.CanExecute())
         {
             existingAction.Execute();
         }
         else
         {
             ITransaction recordingTransaction = RecordingTransaction;
             if (recordingTransaction != null)
             {
                 recordingTransaction.AccumulatingAction.Add(existingAction);
                 if (!recordingTransaction.IsDelayed)
                 {
                     existingAction.Execute();
                 }
             }
             else
             {
                 RunActionDirectly(existingAction);
             }
         }
     }
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:27,代码来源:ActionManager.cs

示例8: ExecuteAction

 private void ExecuteAction(IAction action)
 {
     action.Execute();
       if (ActionPerformed != null) ActionPerformed(this, new ActionEventArgs(action));
 }
开发者ID:OndrejSpanel,项目名称:quickRoute-gps,代码行数:5,代码来源:Canvas.cs

示例9: RecordAction

        /// <summary>
        /// Central method to add and execute a new action.
        /// </summary>
        /// <param name="existingAction">An action to be recorded in the buffer and executed</param>
        public void RecordAction(IAction existingAction)
        {
            if (existingAction == null)
            {
                throw new ArgumentNullException(
                    "ActionManager.RecordAction: the existingAction argument is null");
            }
            // make sure we're not inside an Undo or Redo operation
            CheckNotRunningBeforeRecording(existingAction);

            // if we don't want to record actions, just run and forget it
            if (ExecuteImmediatelyWithoutRecording
                && existingAction.CanExecute())
            {
                existingAction.Execute();
                return;
            }

            // Check if we're inside a transaction that is being recorded
            ITransaction currentTransaction = RecordingTransaction;
            if (currentTransaction != null)
            {
                // if we're inside a transaction, just add the action to the transaction's list
                currentTransaction.AccumulatingAction.Add(existingAction);
                if (!currentTransaction.IsDelayed)
                {
                    existingAction.Execute();
                }
            }
            else
            {
                RunActionDirectly(existingAction);
            }
        }
开发者ID:SmartEncounter,项目名称:SmartLCT-V2.0,代码行数:38,代码来源:ActionManager.cs

示例10: PerformAction

        public bool PerformAction(IAction action)
        {
            if (currentAction < actionList.Count)
            {   //perform an action after some Redo's
                int wegSchmeissCount = actionList.Count - currentAction;
                for (int i = 1; i <= wegSchmeissCount; i++)
                    actionList.RemoveAt(actionList.Count-1);
            }

            bool validAction = action.Execute();
            if (validAction)
            {
                actionList.Add(action);
                if (actionList.Count > actionCount)
                {
                    IAction temp = actionList[0] as IAction;
                    temp.Dispose();
                    actionList.RemoveAt(0);
                } //more than actionCount actions in List
                else currentAction++;

                ActionlistCountChanged(currentAction, actionList.Count);

                changed = true;
            }

            return validAction;
        }
开发者ID:ntj,项目名称:GravurGIS,代码行数:28,代码来源:MainControler.cs

示例11: ExecuteAndRecord

        /// <summary>
        /// Records and executes the given IAction, and executes any existing unexecuted actions. This method must be
        /// called from the thread which owns this object
        /// </summary>
        /// <exception cref="ArgumentNullException">action is null</exception>
        /// <param name="action">The IAction instance to record and execute</param>
        public void ExecuteAndRecord(IAction action)
        {
            VerifyAccess();

            if (action == null)
            {
                throw new ArgumentNullException();
            }

            lock (this)
            {
                if (_lastRecorded != null)
                {
                    Execute();
                    _lastRecorded = null;
                }

                action.Execute();
                _undoStack.Push(action);
                UndoAction = action;
                CanUndo = true;
            }
        }
开发者ID:shivercube,项目名称:HistoryFramework,代码行数:29,代码来源:WpfHistory.cs

示例12: Execute

		public void Execute(IAction action) {
			action.Execute();
			Push(action);
		}
开发者ID:Hakua,项目名称:PokeSharp,代码行数:4,代码来源:ActionManager.cs

示例13: Execute

 public void Execute(IAction hAction)
 {
     hAction.Execute(m_hService, m_hContext);
 }
开发者ID:Alx666,项目名称:Netbase,代码行数:4,代码来源:ServingModeQueue.cs

示例14: Execute

 public virtual void Execute(IAction action)
 {
     action.Execute();
 }
开发者ID:yevhen,项目名称:Servelat-Pieces,代码行数:4,代码来源:Yield.cs

示例15: RecordAction

        public void RecordAction(IAction existingAction)
        {
            if (existingAction == null)
            {
                throw new ArgumentNullException(
                    "ActionManager.RecordAction: the existingAction argument is null");
            }
            CheckNotRunningBeforeRecording(existingAction);

            if (ExecuteImmediatelyWithoutRecording
                && existingAction.CanExecute())
            {
                existingAction.Execute();
                return;
            }

            ITransaction currentTransaction = RecordingTransaction;
            if (currentTransaction != null)
            {
                currentTransaction.AccumulatingAction.Add(existingAction);
            }
            else
            {
                RunActionDirectly(existingAction);
            }
        }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:26,代码来源:ActionManager.cs


注:本文中的IAction.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。