Ejemplo n.º 1
0
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString("Color", _colorConverter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, FillColor));
     writer.WriteElementString("CornerRadius", CornerRadius.ToString(CultureInfo.InvariantCulture));
     if (BorderThickness != 0d)
     {
         writer.WriteStartElement("Border");
         writer.WriteElementString("Thickness", BorderThickness.ToString(CultureInfo.InvariantCulture));
         writer.WriteElementString("Color", _colorConverter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, BorderColor));
         writer.WriteEndElement();
     }
     base.WriteXml(writer);
 }
Ejemplo n.º 2
0
        public override void WriteXml(XmlWriter writer)
        {
            TypeConverter bc = TypeDescriptor.GetConverter(typeof(bool));

            writer.WriteElementString("Color", _colorConverter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, FillColor));
            writer.WriteElementString("CornerRadius", CornerRadius.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("Inverse_direction", bc.ConvertToInvariantString(Inverse_direction));
            if (BorderThickness != 0d)
            {
                writer.WriteStartElement("Border");
                writer.WriteElementString("Thickness", BorderThickness.ToString(CultureInfo.InvariantCulture));
                writer.WriteElementString("Color", _colorConverter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, BorderColor));
                writer.WriteEndElement();
            }

            base.WriteXml(writer);
        }
Ejemplo n.º 3
0
        public override void WriteXml(XmlWriter writer)
        {
            TypeConverter colorConverter = TypeDescriptor.GetConverter(typeof(Color));

            writer.WriteElementString("Image", Image);
            writer.WriteElementString("Alignment", Alignment.ToString());
            writer.WriteElementString("CornerRadius", CornerRadius.ToString(CultureInfo.InvariantCulture));
            if (BorderThickness != 0d)
            {
                writer.WriteStartElement("Border");
                writer.WriteElementString("Thickness", BorderThickness.ToString(CultureInfo.InvariantCulture));
                writer.WriteElementString("Color", colorConverter.ConvertToString(null, System.Globalization.CultureInfo.InvariantCulture, BorderColor));
                writer.WriteEndElement();
            }
            // Save base after image so size is properly persisted.
            base.WriteXml(writer);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates XML for a given style
        /// </summary>
        /// <returns>Style in XML format</returns>
        public string ToXML()
        {
            StringBuilder result = new StringBuilder();

            result.Append("<TableStyle ID=\"" + ID + "\"");
            result.Append(Serialize.Brush(BorderBrush, " BorderBrush", false));
            result.Append(" BorderThickness=\"" + BorderThickness.ToString() + "\"");
            result.Append(Serialize.Brush(CellBorderBrush, " CellBorderBrush", false));
            result.Append(" CellBorderThickness=\"" + CellBorderThickness.ToString() + "\"");
            result.Append(" CellPadding=\"" + CellPadding.ToString(CultureInfo.InvariantCulture) + "\"");
            result.Append(">\r");
            result.Append(Serialize.Brush(Background, "Background", true));
            result.Append(Serialize.Brush(CellFill, "CellFill", true));
            result.Append(Serialize.Brush(HeaderFill, "HeaderFill", true));
            result.Append("</TableStyle>\r");

            return(result.ToString());
        }
Ejemplo n.º 5
0
        public void ToXml(XmlWriter writer)
        {
            var provider = new NumberFormatInfo {
                NumberDecimalSeparator = GlobalProfile.DecimalSymbolStandard.ToString()
            };

            var cultureInfo = new CultureInfo("")
            {
                NumberFormat = { NumberDecimalSeparator = GlobalProfile.DecimalSymbolStandard.ToString() }
            };

            cultureInfo.TextInfo.ListSeparator = GlobalProfile.ArgumentsSeparatorStandard.ToString();

            var colorConverter          = TypeDescriptor.GetConverter(typeof(Color));
            var symbolTypeEnumConverter = TypeDescriptor.GetConverter(typeof(SymbolTypeEnum));

            writer.WriteAttributeString("symbolantialias", AntiAlias.ToString().ToLower());
            writer.WriteAttributeString("symbolsize", SymbolSize.ToString(provider));
            writer.WriteAttributeString("symboltype", symbolTypeEnumConverter.ConvertToString(SymbolType));
            writer.WriteAttributeString("symbolborderthickness", BorderThickness.ToString(provider));
            writer.WriteAttributeString("symbolbordercolor", colorConverter.ConvertToString(null, cultureInfo, BorderColor));
            writer.WriteAttributeString("symbolfillcolor", colorConverter.ConvertToString(null, cultureInfo, FillColor));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Chart 설정 또는 변량에 대해 XML 속성으로 생성합니다.
        /// </summary>
        /// <param name="writer">xml writer</param>
        public override void GenerateXmlAttributes(XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (Draw.HasValue)
            {
                writer.WriteAttributeString("DrawAnchors", Draw.GetHashCode().ToString());
            }
            if (Sides.HasValue)
            {
                writer.WriteAttributeString("AnchorSides", Sides.ToString());
            }
            if (Radius.HasValue)
            {
                writer.WriteAttributeString("AnchorRadius", Radius.ToString());
            }
            if (BorderColor.HasValue)
            {
                writer.WriteAttributeString("AnchorBorderColor", BorderColor.Value.ToHexString());
            }
            if (BorderThickness.HasValue)
            {
                writer.WriteAttributeString("AnchorBorderThickness", BorderThickness.ToString());
            }
            if (BgColor.HasValue)
            {
                writer.WriteAttributeString("AnchorBgColor", BgColor.Value.ToHexString());
            }
            if (Alpha.HasValue)
            {
                writer.WriteAttributeString("AnchorAlpha", Alpha.ToString());
            }
            if (BgAlpha.HasValue)
            {
                writer.WriteAttributeString("AnchorBgAlpha", BgAlpha.ToString());
            }
        }
Ejemplo n.º 7
0
        public virtual void WriteXml(System.Xml.XmlWriter writer)
        {
            //if (!string.IsNullOrWhiteSpace(Title))
            //    writer.WriteAttributeString("Title", Title);

            //if (IconSource != null)
            //    writer.WriteAttributeString("IconSource", IconSource.ToString());

            //if (IsSelected)
            //    writer.WriteAttributeString("IsSelected", IsSelected.ToString());

            //if (IsLastFocusedDocument)
            //    writer.WriteAttributeString("IsLastFocusedDocument", IsLastFocusedDocument.ToString());

            if (!string.IsNullOrWhiteSpace(ContentId))
            {
                writer.WriteAttributeString("ContentId", ContentId);
            }
            if (Margin != 0)
            {
                writer.WriteAttributeString("Margin", Margin.ToString());
            }
            if (BorderThickness != 0)
            {
                writer.WriteAttributeString("BorderThickness", BorderThickness.ToString());
            }
            if (BorderColor != Colors.Transparent)
            {
                writer.WriteAttributeString("BorderColor", BorderColor.ToString());
            }
            if (BackgroundColor != Colors.Transparent)
            {
                writer.WriteAttributeString("BackgroundColor", BackgroundColor.ToString());
            }
            //if (ToolTip != null && ToolTip is string)
            //    if (!string.IsNullOrWhiteSpace((string)ToolTip))
            //        writer.WriteAttributeString("ToolTip", (string)ToolTip);

            //if (FloatingLeft != 0.0)
            //    writer.WriteAttributeString("FloatingLeft", FloatingLeft.ToString(CultureInfo.InvariantCulture));
            //if (FloatingTop != 0.0)
            //    writer.WriteAttributeString("FloatingTop", FloatingTop.ToString(CultureInfo.InvariantCulture));
            //if (FloatingWidth != 0.0)
            //    writer.WriteAttributeString("FloatingWidth", FloatingWidth.ToString(CultureInfo.InvariantCulture));
            //if (FloatingHeight != 0.0)
            //    writer.WriteAttributeString("FloatingHeight", FloatingHeight.ToString(CultureInfo.InvariantCulture));

            //if (IsMaximized)
            //    writer.WriteAttributeString("IsMaximized", IsMaximized.ToString());
            //if (!CanClose)
            //    writer.WriteAttributeString("CanClose", CanClose.ToString());
            //if (!CanFloat)
            //    writer.WriteAttributeString("CanFloat", CanFloat.ToString());

            //if (LastActivationTimeStamp != null)
            //    writer.WriteAttributeString("LastActivationTimeStamp", LastActivationTimeStamp.Value.ToString(CultureInfo.InvariantCulture));

            //if (_previousContainer != null)
            //{
            //    var paneSerializable = _previousContainer as ILayoutPaneSerializable;
            //    if (paneSerializable != null)
            //    {
            //        writer.WriteAttributeString("PreviousContainerId", paneSerializable.Id);
            //        writer.WriteAttributeString("PreviousContainerIndex", _previousContainerIndex.ToString());
            //    }
            //}
        }