本文整理汇总了C#中System.Windows.Forms.TreeNode.IsStateListNode方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.IsStateListNode方法的具体用法?C# TreeNode.IsStateListNode怎么用?C# TreeNode.IsStateListNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeNode
的用法示例。
在下文中一共展示了TreeNode.IsStateListNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
}