public void Assign(CornerShape shape) { TopLeft = shape.topLeft; TopRight = shape.topRight; BottomLeft = shape.bottomLeft; BottomRight = shape.bottomRight; }
/// <summary> /// Converts an object into its XML representation. /// </summary> /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"/> stream to which the object is serialized. </param> public void WriteXml(XmlWriter writer) { writer.WriteElementString("BorderLineStyle", BorderLineStyle.ToString()); writer.WriteElementString("BorderVisibility", BorderVisibility.ToString()); writer.WriteStartElement("CornerShape"); CornerShape.WriteXml(writer); writer.WriteEndElement(); }
public virtual object Clone() { var shape = new CornerShape(); shape.TopLeft = topLeft; shape.TopRight = topRight; shape.BottomLeft = bottomLeft; shape.BottomRight = bottomRight; return(shape); }
/// <summary> /// Generates an object from its XML representation. /// </summary> /// <param name="reader">The <see cref="T:System.Xml.XmlReader"/> stream from which the object is deserialized. </param> public void ReadXml(XmlReader reader) { var doc = new XmlDocument(); doc.Load(reader); if (doc.GetElementsByTagName("BorderLineStyle").Count > 0) { BorderLineStyle = (DashStyle)Enum.Parse(typeof(DashStyle), doc.GetElementsByTagName("BorderLineStyle")[0].InnerText); } if (doc.GetElementsByTagName("BorderVisibility").Count > 0) { BorderVisibility = (ToolStripStatusLabelBorderSides) Enum.Parse(typeof(ToolStripStatusLabelBorderSides), doc.GetElementsByTagName("BorderVisibility")[0].InnerText); } if (doc.GetElementsByTagName("CornerShape").Count > 0) { string xml = "<CornerShape>" + doc.GetElementsByTagName("CornerShape")[0].InnerXml + "</CornerShape>"; CornerShape.ReadXml(new XmlTextReader(xml, XmlNodeType.Document, null)); } }
public virtual bool DefaultChanged() { return(borderLineStyle != DashStyle.Solid || borderVisibility != ToolStripStatusLabelBorderSides.All || CornerShape.DefaultChanged()); }
public BorderAppearance() { cornerShape = new CornerShape(); }
public void ResetCornerShape() { cornerShape = new CornerShape(); }
internal void Assign(BorderAppearance borderAppearance) { CornerShape.Assign((CornerShape)borderAppearance.cornerShape.Clone()); BorderLineStyle = borderAppearance.borderLineStyle; BorderVisibility = borderAppearance.borderVisibility; }
public virtual void Reset() { cornerShape = new CornerShape(); borderLineStyle = DashStyle.Solid; borderVisibility = ToolStripStatusLabelBorderSides.All; }