Пример #1
0
 public bool Equals(LexRelation other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (!EmbeddedXmlElements.SequenceEqual(other.EmbeddedXmlElements))
     {
         return(false);
     }
     if ((_fieldId != null && !_fieldId.Equals(other._fieldId)) || (other._fieldId != null && !other._fieldId.Equals(_fieldId)))
     {
         return(false);
     }
     if ((_targetId != null && !_targetId.Equals(other._targetId)) || (other._targetId != null && !other._targetId.Equals(_targetId)))
     {
         return(false);
     }
     if (!Traits.SequenceEqual(other.Traits))
     {
         return(false);
     }
     if (!Fields.SequenceEqual(other.Fields))
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
        public IPalasoDataObjectProperty Clone()
        {
            var clone = new LexRelation(_fieldId, _targetId, null);

            clone.EmbeddedXmlElements = new List <string>(EmbeddedXmlElements);
            clone.Traits.AddRange(Traits.Select(t => t.Clone()));
            clone.Fields.AddRange(Fields.Select(f => (LexField)f.Clone()));
            return(clone);
        }