/// <summary> /// Caution, only use for built-in borders creating. /// </summary> internal BorderLine(Windows.UI.Color color, BorderLineData style) { this._context = null; this._style = BorderLineStyle.None; this._color = color; this._styleData = style; this._builtIn = true; }
/// <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> void IXmlSerializable.ReadXml(XmlReader reader) { Serializer.InitReader(reader); this._context = null; this._color = Colors.Transparent; this._themeColor = null; this._style = BorderLineStyle.None; this._styleData = null; while (reader.Read()) { string str; if ((reader.NodeType == XmlNodeType.Element) && ((str = reader.Name) != null)) { if (str != "Type") { if (str == "Color") { goto Label_008E; } if (str == "Theme") { goto Label_00AB; } } else { this._style = (BorderLineStyle)Serializer.DeserializeObj(typeof(BorderLineStyle), reader); } } continue; Label_008E: this._color = (Windows.UI.Color)Serializer.DeserializeObj(typeof(Windows.UI.Color), reader); continue; Label_00AB: this._themeColor = (string)(Serializer.DeserializeObj(typeof(string), reader) as string); } }
void InitStyle() { if (this._styleData == null) { switch (this._style) { case BorderLineStyle.None: this._styleData = BorderLineStyleDatas.Empty; return; case BorderLineStyle.Thin: this._styleData = BorderLineStyleDatas.Thin; return; case BorderLineStyle.Medium: this._styleData = BorderLineStyleDatas.Medium; return; case BorderLineStyle.Dashed: this._styleData = BorderLineStyleDatas.Dashed; return; case BorderLineStyle.Dotted: this._styleData = BorderLineStyleDatas.Dotted; return; case BorderLineStyle.Thick: this._styleData = BorderLineStyleDatas.Thick; return; case BorderLineStyle.Double: this._styleData = BorderLineStyleDatas.Double; return; case BorderLineStyle.Hair: this._styleData = BorderLineStyleDatas.Hair; return; case BorderLineStyle.MediumDashed: this._styleData = BorderLineStyleDatas.MediumDashed; return; case BorderLineStyle.DashDot: this._styleData = BorderLineStyleDatas.DashDot; return; case BorderLineStyle.MediumDashDot: this._styleData = BorderLineStyleDatas.MediumDashDot; return; case BorderLineStyle.DashDotDot: this._styleData = BorderLineStyleDatas.DashDotDot; return; case BorderLineStyle.MediumDashDotDot: this._styleData = BorderLineStyleDatas.MediumDashDotDot; return; case BorderLineStyle.SlantedDashDot: this._styleData = BorderLineStyleDatas.SlantedDashDot; return; } this._styleData = BorderLineStyleDatas.Empty; } }