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


C# IAction.ToString方法代码示例

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


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

示例1: CheckNotRunningBeforeRecording

 private void CheckNotRunningBeforeRecording(IAction existingAction)
 {
     string str = (existingAction != null) ? existingAction.ToString() : "";
     if (CurrentAction != null)
     {
         throw new InvalidOperationException(string.Format("ActionManager.RecordActionDirectly: the ActionManager is currently running or undoing an action ({0}), and this action (while being executed) attempted to recursively record another action ({1}), which is not allowed. You can examine the stack trace of this exception to see what the executing action did wrong and change this action not to influence the Undo stack during its execution. Checking if ActionManager.ActionIsExecuting == true before launching another transaction might help to avoid the problem. Thanks and sorry for the inconvenience.", CurrentAction, str));
     }
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:8,代码来源:ActionManager.cs

示例2: storeAction

        public void storeAction(IAction action)
        {
            System.Diagnostics.Debug.WriteLine("Store: " + action.ToString());

              if (!_IsRedoing && !_IsUndoing) _Redo.Clear();

              if (_NumOfEndMacroNeeded > 0)
            _Macro.Add(action);
              else if (_IsUndoing) _Redo.Push(action);
              else _Undo.Push(action);
        }
开发者ID:TungTh,项目名称:Email-Reader,代码行数:11,代码来源:ActionHandler.cs

示例3: Perform

        /// <summary>
        /// Performs the provided action against the turtle
        /// </summary>
        /// <param name="action">IAction - The action instance with which to perform on the turtle</param>
        public void Perform(IAction action)
        {
            if (action == null) return;
            if (_turtle == null) _turtle = new Turtle();

            bool success = action.Perform(_turtle);
            if (success)
            {
                _history.Add(action);

                for (int index = 0; index < _listViews.Count; index ++)
                {
                    _listViews[index].Draw(_turtle);
                    _listViews[index].Print(action.ToString());
                }
            }
        }
开发者ID:J6628426,项目名称:Logo,代码行数:21,代码来源:Conductor.cs

示例4: CreateActionLabels

        private void CreateActionLabels(IAction action, Grid grid, int recursiveCount, 
            ref int posCounter, out Action handleStart, out Action handleStop)
        {
            Label l = new Label();
            l.Margin = new Thickness(recursiveCount * 10, 18 * posCounter, 0, 0);
            grid.Children.Add(l);

            string str = action.ToString();
            l.Content = str;

            handleStart = () => {
                l.Foreground = new SolidColorBrush(Color.FromArgb(255, 29, 134, 184));
            };

            handleStop = () =>
            {
                l.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));
                l.Content = str;
            };

            action.ActionInformationUpdated += s => Dispatcher.Invoke(new Action(() => l.Content = str + " – " + s));

            posCounter++;

            if (action is IActionContainer)
            {
                
                IActionContainer cont = (IActionContainer)action;
                IList<IAction> subActions = cont.SubActions;
                Action[] handleStartActions = new Action[subActions.Count];
                Action[] handleStopActions = new Action[subActions.Count];
                for (int i = 0; i < subActions.Count; i++)
                {
                    CreateActionLabels(subActions[i], grid, recursiveCount + 1, ref posCounter,
                        out handleStartActions[i], out handleStopActions[i]);
                }

                int? currentActiveAction = null;
                cont.SubActionStartedOrStopped += (idx) => Dispatcher.Invoke(new Action(() =>
                {
                    if (idx.HasValue)
                    {
                        currentActiveAction = idx;
                        handleStartActions[idx.Value]();
                    }
                    else if (currentActiveAction.HasValue)
                    {
                        handleStopActions[currentActiveAction.Value]();
                    }
                }));
            }
        }
开发者ID:kpreisser,项目名称:MouseClickSimulator,代码行数:52,代码来源:MainWindow.xaml.cs

示例5: module_ActionExecuted

 private void module_ActionExecuted(ModuleClient m, IAction action, bool success)
 {
     Log.WriteLine(5, m.Name + ": " + action.ToString() + (success ? " Success!!!" : " failed."));
 }
开发者ID:BioRoboticsUNAM,项目名称:Blackboard,代码行数:4,代码来源:Blackboard.cs

示例6: AjouterAction

        public void AjouterAction(IAction action)
        {
            Actions.Add(action);
            Log(action.ToString(), TypeLog.Action);

            while (Actions.Count > NBACTIONSMAX)
                Actions.RemoveAt(0);

            if (NouvelleAction != null)
                NouvelleAction(action);
        }
开发者ID:KiwiJaune,项目名称:GoBot,代码行数:11,代码来源:Historique.cs


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