本文整理汇总了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));
}
}
示例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);
}
示例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());
}
}
}
示例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]();
}
}));
}
}
示例5: module_ActionExecuted
private void module_ActionExecuted(ModuleClient m, IAction action, bool success)
{
Log.WriteLine(5, m.Name + ": " + action.ToString() + (success ? " Success!!!" : " failed."));
}
示例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);
}