Microsoft.VisualStudio.Project.ProjectNode.CompareNodes C# (CSharp) Method

CompareNodes() protected method

Used to sort nodes in the hierarchy.
protected CompareNodes ( HierarchyNode node1, HierarchyNode node2 ) : int
node1 HierarchyNode
node2 HierarchyNode
return int
        protected internal virtual int CompareNodes(HierarchyNode node1, HierarchyNode node2)
        {
            Debug.Assert(node1 != null && node2 != null);
            if (node1 == null)
            {
                throw new ArgumentNullException("node1");
            }

            if (node2 == null)
            {
                throw new ArgumentNullException("node2");
            }

            if (node1.SortPriority == node2.SortPriority)
            {
                return String.Compare(node2.Caption, node1.Caption, true, CultureInfo.CurrentCulture);
            }
            else
            {
                return node2.SortPriority - node1.SortPriority;
            }
        }
ProjectNode