예제 #1
0
        internal DicomElementSq(DicomElementSq attrib, bool copyBinary, bool copyPrivate, bool copyUnknown)
            : base(attrib)
        {
            DicomSequenceItem[] items = (DicomSequenceItem[])attrib.Values;

            if (items != null)
            {
                _values = new DicomSequenceItem[items.Length];
                for (int i = 0; i < items.Length; i++)
                {
                    _values[i] = (DicomSequenceItem)items[i].Copy(copyBinary, copyPrivate, copyUnknown);
                }
            }
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            //Check for null and compare run-time types.
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            DicomElementSq a = (DicomElementSq)obj;

            DicomSequenceItem[] array = (DicomSequenceItem[])a.Values;

            if (Count != a.Count)
            {
                return(false);
            }
            if (Count == 0 && a.Count == 0)
            {
                return(true);
            }
            if (IsNull && a.IsNull)
            {
                return(true);
            }

            if (_values.Length != array.Length)
            {
                return(false);
            }

            for (int i = 0; i < _values.Length; i++)
            {
                if (!array[i].Equals(_values[i]))
                {
                    return(false);
                }
            }

            return(true);
        }