Пример #1
0
        /// <summary>
        /// Implement IComparable CompareTo method.
        /// </summary>
        /// <param name="obj">
        /// The object to compare.
        /// </param>
        /// <returns>
        /// One, two or three.
        /// </returns>
        int IComparable.CompareTo(object obj)
        {
            PeopleGraphNode secondEvent = (PeopleGraphNode)obj;

            // compare on Target first
            int testFlag = string.Compare(NodeHLink.HLinkKey, secondEvent.NodeHLink.HLinkKey, StringComparison.CurrentCulture);

            return(testFlag);
        }
Пример #2
0
        /// <summary>
        /// Compares two objects.
        /// </summary>
        /// <param name="a">
        /// object A.
        /// </param>
        /// <param name="b">
        /// object B.
        /// </param>
        /// <returns>
        /// One, two or three.
        /// </returns>
        int IComparer.Compare(object a, object b)
        {
            PeopleGraphNode firstEvent  = (PeopleGraphNode)a;
            PeopleGraphNode secondEvent = (PeopleGraphNode)b;

            // compare on Priority first
            int testFlag = string.Compare(firstEvent.NodeHLink.HLinkKey, secondEvent.NodeHLink.HLinkKey, StringComparison.CurrentCulture);

            return(testFlag);
        }
Пример #3
0
        /// <summary>
        /// Sorts the by y start.
        /// </summary>
        /// <param name="a">
        /// a.
        /// </param>
        /// <param name="b">
        /// The b.
        /// </param>
        /// <returns>
        /// </returns>
        public static int SortByYStart(PeopleGraphNode a, PeopleGraphNode b)
        {
            if (a is null)
            {
                throw new ArgumentNullException(nameof(a));
            }

            if (b is null)
            {
                throw new ArgumentNullException(nameof(b));
            }

            return(a.YStart.CompareTo(b.YStart));
        }