/// <summary> /// Copy constructor /// </summary> internal IshTypeFieldDefinition(IshTypeFieldDefinition ishTypeFieldDefinition) { _logger = ishTypeFieldDefinition._logger; ISHType = ishTypeFieldDefinition.ISHType; Level = ishTypeFieldDefinition.Level; Name = ishTypeFieldDefinition.Name; DataType = ishTypeFieldDefinition.DataType; IsMandatory = ishTypeFieldDefinition.IsMandatory; IsMultiValue = ishTypeFieldDefinition.IsMultiValue; AllowOnRead = ishTypeFieldDefinition.AllowOnRead; AllowOnCreate = ishTypeFieldDefinition.AllowOnCreate; AllowOnUpdate = ishTypeFieldDefinition.AllowOnUpdate; AllowOnSearch = ishTypeFieldDefinition.AllowOnSearch; IsSystem = ishTypeFieldDefinition.IsSystem; IsBasic = ishTypeFieldDefinition.IsBasic; IsDescriptive = ishTypeFieldDefinition.IsDescriptive; Label = ishTypeFieldDefinition.Label; Description = ishTypeFieldDefinition.Description; ReferenceLov = ishTypeFieldDefinition.ReferenceLov; ReferenceType = ishTypeFieldDefinition.ReferenceType; }
/// <summary> /// The role of IComparable is to provide a method of comparing two objects of a particular type. This is necessary if you want to provide any ordering capability for your object. /// </summary> public int CompareTo(object obj) { IshTypeFieldDefinition b = (IshTypeFieldDefinition)obj; if (!Key.Equals(b.Key, StringComparison.InvariantCulture)) { return(string.Compare(Key, b.Key)); } // Keys match, now check the properties that matter if (!Type.Equals(b.Type, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.Type[{Type}] b.Type[{b.Type}]"); return(string.Compare(Type, b.Type)); } if (!MM.Equals(b.MM, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.MM[{MM}] b.MM[{b.MM}]"); return(string.Compare(MM, b.MM, StringComparison.InvariantCulture)); } if (!CRUS.Equals(b.CRUS, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.CRUS[{CRUS}] b.CRUS[{b.CRUS}]"); return(string.Compare(CRUS, b.CRUS, StringComparison.InvariantCulture)); } if (!SDB.Equals(b.SDB, StringComparison.InvariantCulture)) { _logger.WriteVerbose($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.SDB[{SDB}] b.SDB[{b.SDB}]"); return(string.Compare(SDB, b.SDB, StringComparison.InvariantCulture)); } if (!Description.Equals(b.Description, StringComparison.InvariantCulture)) { _logger.WriteDebug($"IshTypeFieldDefinition.CompareTo a.Key[{Key}] a.Description[{Description}] b.Description[{b.Description}]"); return(0); // Difference in description is nice-to-know but considered equal } return(0); }
internal IshTypeFieldDefinitionCompare(IshTypeFieldDefinition ishTypeFieldDefinition, Compare compare) : base(ishTypeFieldDefinition) { _compareResult = compare; }