当前位置: 首页>>代码示例>>C#>>正文


C# TreeNode.Equals方法代码示例

本文整理汇总了C#中System.Windows.Forms.TreeNode.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.Equals方法的具体用法?C# TreeNode.Equals怎么用?C# TreeNode.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TreeNode的用法示例。


在下文中一共展示了TreeNode.Equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CanDrag

 /// <summary>
 /// 判断源节点是否可以拖拽到目标节点
 /// </summary>
 /// <param name="draggedNode"></param>
 /// <param name="targetNode"></param>
 /// <returns></returns>
 public static bool CanDrag(TreeNode draggedNode, TreeNode targetNode)
 {
     if (targetNode.Tag != null
         || (targetNode.FullPath.IndexOf("\\") == -1 && draggedNode.Tag != null)
         || draggedNode.Parent == targetNode
         || draggedNode.Equals(targetNode)
         || ContainNode(draggedNode, targetNode)
         || targetNode.Nodes.ContainsKey(draggedNode.Name))
     {
         return false;
     }
     return true;
 }
开发者ID:lppco,项目名称:read-more,代码行数:19,代码来源:FormUtil.cs

示例2: TreeNodeCanMoveTo

        /// <summary>
        /// 当前节点是否允许转移到目标节点
        /// </summary>
        /// <param name="currentTreeNode">当前节点</param>
        /// <param name="targetTreeNode">目标节点</param>
        /// <returns>允许</returns>
        public static bool TreeNodeCanMoveTo(TreeNode currentTreeNode, TreeNode targetTreeNode)
        {
            if (currentTreeNode != null)
            {
                // 当前节点不能移动到当前节点上
                if (currentTreeNode.Equals(targetTreeNode))
                {
                    return false;
                }
                // 当前节点的父节点也不用移动了
                //if (currentTreeNode.Parent == targetTreeNode)
                //{
                //    return false;
                //}

                // 季俊武 20110219 当前节点为顶级节点的也不用移动
                // 吉日嘎拉 20110319,顶级节点也能拖动才对
                // if (currentTreeNode.Parent == null)
                // {
                //    return false;
                // }
                // 有相同名字的,不能移动
                for (int i = 0; i < targetTreeNode.Nodes.Count; i++)
                {
                    if (currentTreeNode.Text.Equals(targetTreeNode.Nodes[i].Text))
                    {
                        return false;
                        // break;
                    }
                }
                // 当前节点不能移动到自己的子节点上去
                while (targetTreeNode.Parent != null)
                {
                    targetTreeNode = targetTreeNode.Parent;
                    if (currentTreeNode.Equals(targetTreeNode))
                    {
                        return false;
                    }
                }
            }
            return true;
        }
开发者ID:huoxudong125,项目名称:DotNet,代码行数:48,代码来源:BaseInterfaceLogic.cs

示例3: HandleNestedTransactionGroups

        /// <summary>
        /// Commit or rollback nested transaction groups
        /// </summary>
        /// <param name="operationType">The operation type determines whether to commit or to rollback transaction groups</param>
        private void HandleNestedTransactionGroups(OperationType operationType)
        {
            while (m_transactionGroup != null)
            {
                if (operationType.Equals(OperationType.CommitTransactionGroup))
                {
                    m_transactionGroup.Commit();
                }
                else
                {
                    m_transactionGroup.RollBack();
                }

                if (m_transactionGroup.HasEnded())
                {
                    m_transGroupNode = m_transGroupNode.Parent;
                    if (m_transGroupNode.Equals(m_rootNode))
                    {
                        m_transactionGroup = null;
                    }
                    else
                    {
                        m_transactionGroup = m_transGroupNode.Tag as TransactionGroup;
                    }
                }
                else
                {
                    throw new System.ApplicationException("Could not end a transaction group");
                }
            }
        }
开发者ID:AMEE,项目名称:revit,代码行数:35,代码来源:TransactionForm.cs

示例4: recursiveRunTest

        private void recursiveRunTest(TreeNode treeNode, SeleniumActions seleniumHandle)
        {
            runStepNum++;

            if (treeNode.Equals(startNode))
            {
                runsteps = true;
            }

            if (runsteps)
            {
                //stepBrowser.SelectedNode = treeNode;
                Steps curStep = (Steps)treeNode.Tag;

                Steps tempStep = new Steps();

                tempStep.Keyword = curStep.Keyword;
                tempStep.Value = curStep.Value;
                tempStep.Element = curStep.Element;
                foreach (Variables curVar in runStepVars)
                {
                    tempStep.Value = tempStep.Value.Replace(curVar.Searchstr, curVar.Calculatedvalue);
                    tempStep.Element = tempStep.Element.Replace(curVar.Searchstr, curVar.Calculatedvalue);
                }

                RunLog log = seleniumHandle.ParseAction(tempStep);

                log.Stepnum = runStepNum;
                log.Step = curStep;

                if (!log.Pass)
                {
                    runsteps = false;
                    log.Message = "Step Failed, Aborting Run\n\n" + log.Message;
                }
                    

                

                testCaseWorker.ReportProgress(2, log);
            }

            foreach (TreeNode tn in treeNode.Nodes)
            {
                recursiveRunTest(tn, seleniumHandle);
            }
        }
开发者ID:Maxih,项目名称:selenium-automation-tool,代码行数:47,代码来源:BaseWindow.cs

示例5: RefreshNode

        bool RefreshNode(TreeNode Node)
        {
            if (Node.Equals(LoadingNode))
                return true;
            RegistryNodeData data = (RegistryNodeData)Node.Tag;
            if (!data.LoadedNodes)
            {
                if (IsLoading) return true;
                IsLoading = true;

                if(Node.Nodes.Count > 0)
                    Node.Nodes.Remove(Node.FirstNode);
                Node.Nodes.Add(LoadingNode);

                UpdatingNode = Node;

                TreeNode rootNode = GetRootNode(Node);

                RegistryKeyType key = keyFromNode(rootNode);

                Console.WriteLine("Root Node: {0}", rootNode.Text);

                string path = data.Path;

                Console.WriteLine("Node path: {0}", path);

                Client.Send((byte)NetworkCommand.RegistryEdit, (byte)RegistryCommand.UpdateNodes, (byte)key, path);

            }
            return false;
        }
开发者ID:BahNahNah,项目名称:MLRat,代码行数:31,代码来源:RegistryEditorForm.cs

示例6: keyFromNode

 RegistryKeyType keyFromNode(TreeNode node)
 {
     if (node.Equals(CurrentUser)) return RegistryKeyType.CurrentUser;
     if (node.Equals(LocalMachine)) return RegistryKeyType.LocalMachine;
        // if (node.Equals(ClassesRoot)) return RegistryKeyType.ClassesRoot;
     if (node.Equals(CurrentConfig)) return RegistryKeyType.CurrentConfig;
     if (node.Equals(UsersRoot)) return RegistryKeyType.UserRoot;
     return RegistryKeyType.None;
 }
开发者ID:BahNahNah,项目名称:MLRat,代码行数:9,代码来源:RegistryEditorForm.cs


注:本文中的System.Windows.Forms.TreeNode.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。