本文整理匯總了C#中System.Windows.Forms.TreeNode.IsStateCategoryNode方法的典型用法代碼示例。如果您正苦於以下問題:C# TreeNode.IsStateCategoryNode方法的具體用法?C# TreeNode.IsStateCategoryNode怎麽用?C# TreeNode.IsStateCategoryNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.TreeNode
的用法示例。
在下文中一共展示了TreeNode.IsStateCategoryNode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Compare
public static int Compare(TreeNode first, TreeNode second)
{
bool isFirstCategory = first.IsStateCategoryNode();
bool isSecondCategory = second.IsStateCategoryNode();
if (isFirstCategory && !isSecondCategory)
{
return -1;
}
else if (isSecondCategory && !isFirstCategory)
{
return 1;
}
else
{
return first.Text.CompareTo(second.Text);
}
}
示例2: PopulateRightClickItems
//.........這裏部分代碼省略.........
#endregion
#region IsCodeNode
else if (node.IsCodeNode())
{
menu.Items.Add(form.viewInExplorerToolStripMenuItem);
menu.Items.Add(form.reGenerateCodeToolStripMenuItem);
}
#endregion
#region IsRootCodeNode
else if (node.IsRootCodeNode())
{
menu.Items.Add(form.reGenerateCodeToolStripMenuItem);
}
#endregion
#region IsDirectoryNode
else if (node.IsDirectoryNode())
{
//menu.Items.Add(form.viewInExplorerToolStripMenuItem);
menu.Items.Add(mViewContentFilesInExplorer);
menu.Items.Add(mViewCodeFolderInExplorer);
menu.Items.Add("-");
menu.Items.Add(form.addFolderToolStripMenuItem);
if (node.Root().IsRootEntityNode())
{
menu.Items.Add(form.addEntityToolStripMenuItem);
mImportElement.Text = "Import Entity";
menu.Items.Add(mImportElement);
}
else
{
// If not in the Entities tree structure, assume global content
menu.Items.Add(form.addFileToolStripMenuItem);
}
menu.Items.Add("-");
menu.Items.Add(mDeleteFolder);
}
#endregion
#region IsStateListNode
else if (node.IsStateListNode())
{
menu.Items.Add(mAddState);
menu.Items.Add(mAddStateCategory);
}
#endregion
#region IsStateCategoryNode
else if (node.IsStateCategoryNode())
{
menu.Items.Add(mAddState);
AddRemoveFromProjectItems(form, menu);
}
#endregion
#region IsStateNode
else if (node.IsStateNode())
{
AddRemoveFromProjectItems(form, menu);
menu.Items.Add("-");
menu.Items.Add(mDuplicate);
menu.Items.Add("-");
menu.Items.Add(mFillValuesFromDefault);
}
#endregion
#region IsEventTreeNode
else if (node.IsEventResponseTreeNode())
{
AddRemoveFromProjectItems(form, menu);
}
#endregion
PluginManager.ReactToTreeViewRightClick(node, menu);
}
示例3: MoveState
private static void MoveState(TreeNode nodeMoving, TreeNode targetNode)
{
IElement currentElement = EditorLogic.CurrentElement;
StateSave toAdd = (StateSave)nodeMoving.Tag;
IElement sourceContainer = nodeMoving.GetContainingElementTreeNode().Tag as IElement;
IElement targetContainer = targetNode.GetContainingElementTreeNode().Tag as IElement;
if (targetNode.IsStateCategoryNode() || targetNode.IsStateListNode())
{
if (sourceContainer == targetContainer)
{
EditorLogic.CurrentElement.RemoveState(EditorLogic.CurrentStateSave);
}
else
{
toAdd = toAdd.Clone();
}
if (targetNode.IsStateCategoryNode())
{
((StateSaveCategory)targetNode.Tag).States.Add(toAdd);
}
else
{
targetContainer.States.Add(toAdd);
}
GlueCommands.Self.GenerateCodeCommands.GenerateElementCode(targetContainer);
GlueCommands.Self.RefreshCommands.RefreshUi(targetContainer);
}
}