/// <summary> /// Creates a builder with all style properties inherited. /// </summary> public StyleBuilder() { font = StyleProperty <Font> .Inherit; color = StyleProperty <Color> .Inherit; tabStopRuler = StyleProperty <TabStopRuler> .Inherit; wordWrap = StyleProperty <bool> .Inherit; leftMargin = StyleProperty <int> .Inherit; rightMargin = StyleProperty <int> .Inherit; firstLineIndent = StyleProperty <int> .Inherit; }
/// <summary> /// Creates a builder initialized as a copy of an existing style builder. /// </summary> /// <param name="styleBuilder">The style builder to copy.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="styleBuilder"/> is null.</exception> public StyleBuilder(StyleBuilder styleBuilder) { if (styleBuilder == null) { throw new ArgumentNullException("styleBuilder"); } font = styleBuilder.Font; color = styleBuilder.Color; tabStopRuler = styleBuilder.TabStopRuler; wordWrap = styleBuilder.WordWrap; leftMargin = styleBuilder.LeftMargin; rightMargin = styleBuilder.RightMargin; firstLineIndent = styleBuilder.FirstLineIndent; }
/// <summary> /// Creates a builder initialized as a copy of an existing style. /// </summary> /// <param name="style">The style to copy.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="style"/> is null.</exception> public StyleBuilder(Style style) { if (style == null) { throw new ArgumentNullException("style"); } font = new StyleProperty <Font>(style.Font); color = new StyleProperty <Color>(style.Color); tabStopRuler = new StyleProperty <TabStopRuler>(style.TabStopRuler); wordWrap = new StyleProperty <bool>(style.WordWrap); leftMargin = new StyleProperty <int>(style.LeftMargin); rightMargin = new StyleProperty <int>(style.RightMargin); firstLineIndent = new StyleProperty <int>(style.FirstLineIndent); }
/// <inheritdoc /> public bool Equals(StyleProperty <T> other) { return(this == other); }