Esempio n. 1
0
        public int CompareTo(DicomTag other)
        {
            if (Group != other.Group)
            {
                return(Group.CompareTo(other.Group));
            }

            if (Element != other.Element)
            {
                return(Element.CompareTo(other.Element));
            }

            // sort by private creator only if element values are equal
            if (PrivateCreator != null || other.PrivateCreator != null)
            {
                if (PrivateCreator == null)
                {
                    return(-1);
                }
                if (other.PrivateCreator == null)
                {
                    return(1);
                }

                if (PrivateCreator != other.PrivateCreator)
                {
                    return(PrivateCreator.CompareTo(other.PrivateCreator));
                }
            }

            return(0);
        }
Esempio n. 2
0
        public int CompareTo(DicomTag other)
        {
            if (Group != other.Group)
            {
                return(Group.CompareTo(other.Group));
            }

            if (PrivateCreator != null || other.PrivateCreator != null)
            {
                if (PrivateCreator == null)
                {
                    return(-1);
                }
                if (other.PrivateCreator == null)
                {
                    return(1);
                }

                int compare = PrivateCreator.CompareTo(other.PrivateCreator);
                if (compare != 0)
                {
                    return(compare);
                }

                return((Element & 0xff).CompareTo(other.Element & 0xff));
            }

            if (Element != other.Element)
            {
                return(Element.CompareTo(other.Element));
            }

            return(0);
        }