using System; using CPF.Drawing; namespace CPF.ReoGrid { public class ReferenceRangeStyle : ReferenceStyle { internal ReferenceRange Range { get { return this.range; } } internal ReferenceRangeStyle(Worksheet grid, ReferenceRange range) : base(grid) { this.range = range; } public Color BackColor { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.BackColor); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.BackColor, value); } } public Color TextColor { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.TextColor); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.TextColor, value); } } public string FontName { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.FontName); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.FontName, value); } } public float FontSize { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.FontSize); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.FontSize, value); } } public bool Bold { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.FontStyleBold); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.FontStyleBold, value); } } public bool Italic { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.FontStyleItalic); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.FontStyleItalic, value); } } public bool Underline { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.FontStyleUnderline); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.FontStyleUnderline, value); } } public bool Strikethrough { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.FontStyleStrikethrough); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.FontStyleStrikethrough, value); } } public ReoGridHorAlign HorizontalAlign { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.HorizontalAlign); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.HorizontalAlign, value); } } public ReoGridVerAlign VerticalAlign { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.VerticalAlign); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.VerticalAlign, value); } } public PaddingValue Padding { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.Padding); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.Padding, value); } } public TextWrapMode TextWrap { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.TextWrap); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.TextWrap, value); } } public ushort Indent { get { this.CheckForReferenceOwner(this.range); return this.GetStyle(this.range, PlainStyleFlag.Indent); } set { this.CheckForReferenceOwner(this.range); this.SetStyle(this.range, PlainStyleFlag.Padding, value); } } private ReferenceRange range; } }