public override int GetHashCode() { unchecked { int result = (Name != null ? Name.GetHashCode() : 0); result = result * 397 ^ (RowSource != null ? RowSource.GetHashCode() : 0); result = (result * 397) ^ CollectionUtil.GetHashCodeDeep(Columns); result = (result * 397) ^ CollectionUtil.GetHashCodeDeep(Filters); result = (result * 397) ^ SublistId.GetHashCode(); return(result); } }
// ReSharper restore NonLocalizedString public bool Equals(ViewSpec other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.Name, Name) && Equals(other.RowSource, RowSource) && Columns.SequenceEqual(other.Columns) && Filters.SequenceEqual(other.Filters) && SublistId.Equals(other.SublistId)); }
private ImageIndexes GetImageIndex(ColumnDescriptor columnDescriptor) { if (null == columnDescriptor) { return(0); } if (null != columnDescriptor.CollectionInfo) { if (null != SublistId && SublistId.StartsWith(columnDescriptor.PropertyPath)) { return(ImageIndexes.Sublist); } return(ImageIndexes.Pivot); } var propertyType = columnDescriptor.PropertyType; if (null == propertyType) { return(ImageIndexes.Unknown); } if (typeof(ILinkValue).IsAssignableFrom(propertyType)) { return(ImageIndexes.Link); } propertyType = columnDescriptor.DataSchema.GetWrappedValueType(propertyType); if (typeof(string) == propertyType) { return(ImageIndexes.Text); } if (typeof(bool) == propertyType) { return(ImageIndexes.Boolean); } if (propertyType.IsPrimitive) { return(ImageIndexes.Number); } return(ImageIndexes.Unknown); }