Ejemplo n.º 1
0
        internal void Write(XmlWriter writer)
        {
            writer.WriteAttributeString("DataType", DataType);
            writer.WriteAttributeString("Filename", Filename);

            if (ColorScale != null)
            {
                writer.WriteStartElement("ColorScale");
                ColorScale.Write(writer);
                writer.WriteEndElement();
            }
        }
Ejemplo n.º 2
0
        internal static MeshValueEntry Read(XmlReader reader)
        {
            var dataType = reader.GetAttribute("DataType");
            var filename = reader.GetAttribute("Filename");

            ColorScale colorScale = null;

            var colorScaleReader = reader.ReadSubtree();

            while (colorScaleReader.ReadToFollowing("ColorScale") && colorScaleReader.NodeType == XmlNodeType.Element)
            {
                colorScale = ColorScale.Read(colorScaleReader);
            }
            return(new MeshValueEntry(dataType, filename, colorScale));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MeshValueEntry"/> class.
 /// </summary>
 /// <param name="dataType">Type of the data.</param>
 /// <param name="filename">The filename which is used during serialization.</param>
 /// <param name="colorScale">The color scale.</param>
 public MeshValueEntry(string dataType, string filename, ColorScale colorScale = null)
 {
     DataType   = dataType.ToLowerInvariant();
     Filename   = filename;
     ColorScale = colorScale;
 }