public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (ShowLabel.HasValue)
            {
                writer.WriteAttributeString("showLabel", ShowLabel.GetHashCode().ToString());
            }
            if (ToolText.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("toolText", ToolText);
            }
            if (Label.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("label", Label);
            }

            if (ShowLabelBorder.HasValue)
            {
                writer.WriteAttributeString("showLabelBorder", ShowLabelBorder.GetHashCode().ToString());
            }

            if (LabelPosition.HasValue)
            {
                writer.WriteAttributeString("LabelPosition", LabelPosition.GetHashCode().ToString());
            }
            if (LabelHAlign.HasValue)
            {
                writer.WriteAttributeString("LabelHAlign", LabelHAlign.GetHashCode().ToString());
            }
            if (LabelVAlign.HasValue)
            {
                writer.WriteAttributeString("LabelVAlign", LabelVAlign.GetHashCode().ToString());
            }
        }
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (X.HasValue)
            {
                writer.WriteAttributeString("x", X.ToString());
            }
            if (Label.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("label", Label);
            }
            if (LineDashed.HasValue)
            {
                writer.WriteAttributeString("lineDashed", LineDashed.GetHashCode().ToString());
            }
            if (ShowVerticalLine.HasValue)
            {
                writer.WriteAttributeString("showVerticalLine", ShowVerticalLine.GetHashCode().ToString());
            }
            if (ShowLabel.HasValue)
            {
                writer.WriteAttributeString("showLabel", ShowLabel.GetHashCode().ToString());
            }
            if (ToolText.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("toolText", ToolText);
            }
        }
示例#3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ShowIcon != false)
            {
                hash ^= ShowIcon.GetHashCode();
            }
            if (ShowLabel != false)
            {
                hash ^= ShowLabel.GetHashCode();
            }
            if (ShowGauge != false)
            {
                hash ^= ShowGauge.GetHashCode();
            }
            if (Style.Length != 0)
            {
                hash ^= Style.GetHashCode();
            }
            if (Min != 0D)
            {
                hash ^= Min.GetHashCode();
            }
            if (Max != 0D)
            {
                hash ^= Max.GetHashCode();
            }
            if (Label.Length != 0)
            {
                hash ^= Label.GetHashCode();
            }
            if (CustomLabel.Length != 0)
            {
                hash ^= CustomLabel.GetHashCode();
            }
            if (Inline != false)
            {
                hash ^= Inline.GetHashCode();
            }
            if (Zoom.Length != 0)
            {
                hash ^= Zoom.GetHashCode();
            }
            return(hash);
        }
示例#4
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (Label.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("label", Label);
            }
            if (DisplayValue.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("displayValue", DisplayValue);
            }
            if (Color.HasValue)
            {
                writer.WriteAttributeString("color", Color.Value.ToHexString());
            }
            if (Alpha.HasValue)
            {
                writer.WriteAttributeString("alpha", Alpha.ToString());
            }

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

            if (ToolText.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("toolText", ToolText);
            }
            if (ShowLabel.HasValue)
            {
                writer.WriteAttributeString("showLabel", ShowLabel.GetHashCode().ToString());
            }
            if (Dashed.HasValue)
            {
                writer.WriteAttributeString("dashed", Dashed.GetHashCode().ToString());
            }

            if (_anchor != null)
            {
                _anchor.GenerateXmlAttributes(writer);
            }
        }
        /// <summary>
        /// Return a serialized string of values for the pre value editor model
        /// </summary>
        /// <returns></returns>
        public override string GetSerializedValue()
        {
            var xml = new XElement("preValues",
                                   new XElement("preValue", new XAttribute("name", "ShowLabel"), new XCData(ShowLabel.ToString())),
                                   new XElement("preValue", new XAttribute("name", "ShowContextMenu"), new XCData(ShowContextMenu.ToString())),
                                   new XElement("preValue", new XAttribute("name", "Size"),
                                                new XCData(Size.Width + "x" + Size.Height)),
                                   new XElement("preValue", new XAttribute("name", "Features"),
                                                new XCData(
                                                    string.Join(",", Features
                                                                .Where(x => x.Selected)
                                                                .Select(x => x.Value).ToArray()))),
                                   new XElement("preValue", new XAttribute("name", "Stylesheets"),
                                                new XCData(
                                                    string.Join(",", Stylesheets
                                                                .Where(x => x.Selected)
                                                                .Select(x => x.Value).ToArray()))),
                                   new XElement("preValue", new XAttribute("name", "IsRequired"),
                                                new XCData(IsRequired.ToString())));

            if (!ValidElements.IsNullOrWhiteSpace())
            {
                xml.Add(new XElement("preValue", new XAttribute("name", "validElements"), new XCData(ValidElements.Trim())));
            }

            return(xml.ToString());
        }