Exemplo n.º 1
0
        /// <summary>
        /// Chart 설정 또는 변량에 대해 XML로 생성합니다.
        /// </summary>
        /// <param name="writer">xml writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (Show.HasValue)
            {
                writer.WriteAttributeString("Show" + LegendPrefix, Show.Value.GetHashCode().ToString());
            }
            if (Caption.IsNotWhiteSpace())
            {
                writer.WriteAttributeString(LegendPrefix + "Caption", Caption);
            }

            if (BorderColor.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "BorderColor", BorderColor.Value.ToHexString());
            }
            if (BorderThickness.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "BorderThickness", BorderThickness.Value.ToString());
            }
            if (BorderAlpha.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "BorderAlpha", BorderAlpha.Value.ToString());
            }

            if (BgColor.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "BgColor", BgColor.Value.ToHexString());
            }
            if (BgAlpha.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "BgAlpha", BgAlpha.Value.ToString());
            }

            if (Shadow.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "Shadow", Shadow.Value.GetHashCode().ToString());
            }
            if (AllowDrag.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "AllowDrag", AllowDrag.Value.GetHashCode().ToString());
            }

            if (ScrollBgColor.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "ScrollBgColor", ScrollBgColor.Value.ToHexString());
            }
            if (ScrollBarColor.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "ScrollBarColor", ScrollBarColor.Value.ToHexString());
            }
            if (ScrollBtnColor.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "ScrollBtnColor", ScrollBtnColor.Value.ToHexString());
            }

            if (Reverse.HasValue)
            {
                writer.WriteAttributeString("Reverse" + LegendPrefix, Reverse.Value.GetHashCode().ToString());
            }
            if (Padding.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "Padding", Padding.Value.ToString());
            }

            if (MarkerCircle.HasValue)
            {
                writer.WriteAttributeString(LegendPrefix + "MarkerCircle", MarkerCircle.GetHashCode().ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            // NOTE: 자동으로 속성을 XmlAttribute로 생성합니다 (개발 중)
            // ChartExtensions.WriteChartAttribute((ChartBase)this, writer);

            if (Id.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("id", Id);
            }
            if (Caption.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("caption", Caption);
            }
            if (SubCaption.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("subCaption", SubCaption);
            }

            if (Animation.HasValue)
            {
                writer.WriteAttributeString("animation", Animation.Value.GetHashCode().ToString());
            }
            if (DefaultAnimation.HasValue)
            {
                writer.WriteAttributeString("defaultAnimation", DefaultAnimation.Value.GetHashCode().ToString());
            }

            if (Palette.HasValue)
            {
                writer.WriteAttributeString("palette", Palette.Value.ToString());
            }

            if (PaletteThemeColor.HasValue)
            {
                writer.WriteAttributeString("paletteThemeColor", PaletteThemeColor.Value.ToHexString());
            }

            if (ShowPrintMenuItem.HasValue)
            {
                writer.WriteAttributeString("showPrintMenuItem", ShowPrintMenuItem.Value.GetHashCode().ToString());
            }

            if (ShowLabels.HasValue)
            {
                writer.WriteAttributeString("showLabels", ShowLabels.Value.GetHashCode().ToString());
            }
            if (ShowShadow.HasValue)
            {
                writer.WriteAttributeString("ShowShadow", ShowShadow.GetHashCode().ToString());
            }
            if (ShowValues.HasValue)
            {
                writer.WriteAttributeString("ShowValues", ShowValues.GetHashCode().ToString());
            }
            if (RotateValues.HasValue)
            {
                writer.WriteAttributeString("RotateValues", RotateValues.GetHashCode().ToString());
            }

            if (_clickURL != null)
            {
                _clickURL.GenerateXmlAttributes(writer);
            }

            if (_backgroundAttr != null)
            {
                _backgroundAttr.GenerateXmlAttributes(writer);
            }
            if (_borderAttr != null)
            {
                _borderAttr.GenerateXmlAttributes(writer);
            }
            if (_cosmeticAttr != null)
            {
                _cosmeticAttr.GenerateXmlAttributes(writer);
            }
            if (_baseFontAttr != null)
            {
                _baseFontAttr.GenerateXmlAttributes(writer);
            }

            if (_toolTipAttr != null)
            {
                _toolTipAttr.GenerateXmlAttributes(writer);
            }
            if (_logoAttr != null)
            {
                _logoAttr.GenerateXmlAttributes(writer);
            }
            if (_aboutMenuItemAttr != null)
            {
                _aboutMenuItemAttr.GenerateXmlAttributes(writer);
            }
            if (_exportDataMenuItemAttr != null)
            {
                _exportDataMenuItemAttr.GenerateXmlAttributes(writer);
            }
            if (_exportAttr != null)
            {
                _exportAttr.GenerateXmlAttributes(writer);
            }
            if (_legendAttr != null)
            {
                _legendAttr.GenerateXmlAttributes(writer);
            }
            if (_scrollBarAttr != null)
            {
                _scrollBarAttr.GenerateXmlAttributes(writer);
            }
            if (_marginAttr != null)
            {
                _marginAttr.GenerateXmlAttributes(writer);
            }
            if (_numberAttr != null)
            {
                _numberAttr.GenerateXmlAttributes(writer);
            }

            if (CaptionPadding.HasValue)
            {
                writer.WriteAttributeString("CaptionPadding", CaptionPadding.ToString());
            }
            if (XAxisNamePadding.HasValue)
            {
                writer.WriteAttributeString("XAxisNamePadding", XAxisNamePadding.ToString());
            }
            if (LabelPadding.HasValue)
            {
                writer.WriteAttributeString("LabelPadding", LabelPadding.ToString());
            }
            if (ValuePadding.HasValue)
            {
                writer.WriteAttributeString("ValuePadding", ValuePadding.ToString());
            }
            if (CanvasPadding.HasValue)
            {
                writer.WriteAttributeString("CanvasPadding", CanvasPadding.ToString());
            }
            if (LegendPadding.HasValue)
            {
                writer.WriteAttributeString("LegendPadding", LegendPadding.ToString());
            }
            if (PlotSpacePercent.HasValue)
            {
                writer.WriteAttributeString("PlotSpacePercent", PlotSpacePercent.ToString());
            }

            if (_chartMarginAtrr != null)
            {
                _chartMarginAtrr.GenerateXmlAttributes(writer);
            }
            if (_canvasMarginAttr != null)
            {
                _canvasMarginAttr.GenerateXmlAttributes(writer);
            }
        }