本文整理汇总了C#中Command.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Command.Equals方法的具体用法?C# Command.Equals怎么用?C# Command.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command.Equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayResult
private ContentProcessorResult DisplayResult(string content, ContentProcessorResult result, Command command)
{
if (command.Equals(Command.DisplayNegativeCount))
{
_inputOutput.WriteLine("Scanned the text:");
}
_inputOutput.WriteLine(content);
if (command.Equals(Command.DisplayNegativeCount) || command.Equals(Command.DisplayOriginalContent))
{
_inputOutput.WriteLine("Total Number of negative words: " + result.NegativeWordsCount);
}
_inputOutput.WriteLine("Press ANY key to exit.");
_inputOutput.ReadKey();
return result;
}
示例2: CommandFinished
public virtual void CommandFinished(Command command)
{
if (command.Equals(currentCommand))
{
currentCommand = null;
}
else
{
throw new Exception("El comando finalizado no era el actual");
}
}
示例3: Run
public ContentProcessorResult Run(Command command, string content, IList<string> negativeWords)
{
content = content ?? "";
negativeWords = negativeWords ?? new List<string>();
var matches = GetNegativeWordMatches(content, negativeWords);
var result = new ContentProcessorResult
{
NegativeWordsCount = matches.Count,
Content = command.Equals(Command.FilterNegative) ? MaskNegativeWords(content, matches) : content
};
return DisplayResult(result.Content, result, command);
}
示例4: DrawCommandUI
public void DrawCommandUI(Flowchart flowchart, Command inspectCommand)
{
ResizeScrollView(flowchart);
GUILayout.Space(7);
activeBlockEditor.DrawButtonToolbar();
commandScrollPos = GUILayout.BeginScrollView(commandScrollPos);
if (inspectCommand != null)
{
if (activeCommandEditor == null ||
!inspectCommand.Equals(activeCommandEditor.target))
{
// See if we have a cached version of the command editor already,
var editors = (from e in cachedCommandEditors where (e != null && (e.target.Equals(inspectCommand))) select e);
if (editors.Count() > 0)
{
// Use cached editor
activeCommandEditor = editors.First();
}
else
{
// No cached editor, so create a new one.
activeCommandEditor = Editor.CreateEditor((Command)inspectCommand) as CommandEditor;
cachedCommandEditors.Add(activeCommandEditor);
}
}
if (activeCommandEditor != null)
{
activeCommandEditor.DrawCommandInspectorGUI();
}
}
GUILayout.EndScrollView();
GUILayout.EndArea();
// Draw the resize bar after everything else has finished drawing
// This is mainly to avoid incorrect indenting.
Rect resizeRect = new Rect(0, topPanelHeight + flowchart.BlockViewHeight + 1, Screen.width, 4f);
GUI.color = new Color(0.64f, 0.64f, 0.64f);
GUI.DrawTexture(resizeRect, EditorGUIUtility.whiteTexture);
resizeRect.height = 1;
GUI.color = new Color32(132, 132, 132, 255);
GUI.DrawTexture(resizeRect, EditorGUIUtility.whiteTexture);
resizeRect.y += 3;
GUI.DrawTexture(resizeRect, EditorGUIUtility.whiteTexture);
GUI.color = Color.white;
Repaint();
}