CPF/CPF.ReoGrid/ReferenceRangeStyle.cs

206 lines
4.3 KiB
C#
Raw Normal View History

2024-06-24 10:15:59 +08:00
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<Color>(this.range, PlainStyleFlag.BackColor);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<Color>(this.range, PlainStyleFlag.BackColor, value);
}
}
public Color TextColor
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<Color>(this.range, PlainStyleFlag.TextColor);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<Color>(this.range, PlainStyleFlag.TextColor, value);
}
}
public string FontName
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<string>(this.range, PlainStyleFlag.FontName);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<string>(this.range, PlainStyleFlag.FontName, value);
}
}
public float FontSize
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<float>(this.range, PlainStyleFlag.FontSize);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<float>(this.range, PlainStyleFlag.FontSize, value);
}
}
public bool Bold
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<bool>(this.range, PlainStyleFlag.FontStyleBold);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<bool>(this.range, PlainStyleFlag.FontStyleBold, value);
}
}
public bool Italic
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<bool>(this.range, PlainStyleFlag.FontStyleItalic);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<bool>(this.range, PlainStyleFlag.FontStyleItalic, value);
}
}
public bool Underline
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<bool>(this.range, PlainStyleFlag.FontStyleUnderline);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<bool>(this.range, PlainStyleFlag.FontStyleUnderline, value);
}
}
public bool Strikethrough
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<bool>(this.range, PlainStyleFlag.FontStyleStrikethrough);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<bool>(this.range, PlainStyleFlag.FontStyleStrikethrough, value);
}
}
public ReoGridHorAlign HorizontalAlign
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<ReoGridHorAlign>(this.range, PlainStyleFlag.HorizontalAlign);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<ReoGridHorAlign>(this.range, PlainStyleFlag.HorizontalAlign, value);
}
}
public ReoGridVerAlign VerticalAlign
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<ReoGridVerAlign>(this.range, PlainStyleFlag.VerticalAlign);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<ReoGridVerAlign>(this.range, PlainStyleFlag.VerticalAlign, value);
}
}
public PaddingValue Padding
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<PaddingValue>(this.range, PlainStyleFlag.Padding);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<PaddingValue>(this.range, PlainStyleFlag.Padding, value);
}
}
public TextWrapMode TextWrap
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<TextWrapMode>(this.range, PlainStyleFlag.TextWrap);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<TextWrapMode>(this.range, PlainStyleFlag.TextWrap, value);
}
}
public ushort Indent
{
get
{
this.CheckForReferenceOwner(this.range);
return this.GetStyle<ushort>(this.range, PlainStyleFlag.Indent);
}
set
{
this.CheckForReferenceOwner(this.range);
this.SetStyle<ushort>(this.range, PlainStyleFlag.Padding, value);
}
}
private ReferenceRange range;
}
}