Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ColumnFormats != null ? ColumnFormats.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (RowTransforms != null ? RowTransforms.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ClusterSpec != null ? ClusterSpec.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #2
0
        // ReSharper disable LocalizableElement
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteAttributeString("name", Name);
            foreach (var columnFormat in ColumnFormats)
            {
                writer.WriteStartElement("columnFormat");
                writer.WriteAttributeString("column", columnFormat.Item1.ToPersistedString());
                if (columnFormat.Item2.Width.HasValue)
                {
                    writer.WriteAttributeString("width", columnFormat.Item2.Width.ToString());
                }
                if (!string.IsNullOrEmpty(columnFormat.Item2.Format))
                {
                    writer.WriteAttributeString("format", columnFormat.Item2.Format);
                }
                writer.WriteEndElement();
            }
            foreach (var rowTransform in RowTransforms)
            {
                if (rowTransform is PivotSpec pivotSpec)
                {
                    writer.WriteStartElement("pivot");
                    pivotSpec.WriteXml(writer);
                    writer.WriteEndElement();
                }
                else if (rowTransform is RowFilter rowFilter)
                {
                    writer.WriteStartElement("rowFilter");
                    rowFilter.WriteXml(writer);
                    writer.WriteEndElement();
                }
            }

            if (ClusterSpec != null)
            {
                writer.WriteStartElement("cluster");
                ClusterSpec.WriteXml(writer);
                writer.WriteEndElement();
            }
        }