當前位置: 首頁>>代碼示例>>C#>>正文


C# TreeNode.IsStateCategoryNode方法代碼示例

本文整理匯總了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);
            }


        }
開發者ID:vchelaru,項目名稱:FlatRedBall,代碼行數:20,代碼來源:StateListTreeNode.cs

示例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);
        }
開發者ID:gitter-badger,項目名稱:FlatRedBall,代碼行數:101,代碼來源:RightClickHelper.cs

示例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);

            }


        }
開發者ID:gitter-badger,項目名稱:FlatRedBall,代碼行數:35,代碼來源:ElementViewWindow.DragDrop.cs


注:本文中的System.Windows.Forms.TreeNode.IsStateCategoryNode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。