150 lines
2.7 KiB
C#
150 lines
2.7 KiB
C#
using System;
|
|
using CPF.Drawing;
|
|
|
|
namespace CPF.ReoGrid
|
|
{
|
|
[Serializable]
|
|
public struct RangeBorderStyle
|
|
{
|
|
public BorderLineStyle Style
|
|
{
|
|
get
|
|
{
|
|
return this.style;
|
|
}
|
|
set
|
|
{
|
|
this.style = value;
|
|
}
|
|
}
|
|
|
|
public Color Color
|
|
{
|
|
get
|
|
{
|
|
return this.color;
|
|
}
|
|
set
|
|
{
|
|
this.color = value;
|
|
}
|
|
}
|
|
|
|
public bool IsEmpty
|
|
{
|
|
get
|
|
{
|
|
return this.Equals(RangeBorderStyle.Empty);
|
|
}
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
bool flag = obj == null && this.IsEmpty;
|
|
bool result;
|
|
if (flag)
|
|
{
|
|
result = true;
|
|
}
|
|
else
|
|
{
|
|
bool flag2 = !(obj is RangeBorderStyle);
|
|
if (flag2)
|
|
{
|
|
result = false;
|
|
}
|
|
else
|
|
{
|
|
RangeBorderStyle rangeBorderStyle = (RangeBorderStyle)obj;
|
|
result = (this.style == rangeBorderStyle.style && this.color == rangeBorderStyle.color);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public static bool operator ==(RangeBorderStyle s1, object s2)
|
|
{
|
|
return s1.Equals(s2);
|
|
}
|
|
|
|
public static bool operator !=(RangeBorderStyle s1, object s2)
|
|
{
|
|
return !s1.Equals(s2);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Format("RangeBorderStyle[Color={0},Style={1}]", this.color, this.style);
|
|
}
|
|
|
|
public RangeBorderStyle(Color color, BorderLineStyle style)
|
|
{
|
|
this.color = color;
|
|
this.style = style;
|
|
}
|
|
|
|
public static readonly RangeBorderStyle Empty = new RangeBorderStyle
|
|
{
|
|
color = Color.Transparent,
|
|
style = BorderLineStyle.None
|
|
};
|
|
|
|
private BorderLineStyle style;
|
|
|
|
private Color color;
|
|
|
|
public static readonly RangeBorderStyle BlackSolid = new RangeBorderStyle
|
|
{
|
|
Color = Color.Black,
|
|
Style = BorderLineStyle.Solid
|
|
};
|
|
|
|
public static readonly RangeBorderStyle BlackBoldSolid = new RangeBorderStyle
|
|
{
|
|
Color = Color.Black,
|
|
Style = BorderLineStyle.BoldSolid
|
|
};
|
|
|
|
public static readonly RangeBorderStyle GraySolid = new RangeBorderStyle
|
|
{
|
|
Color = Color.Gray,
|
|
Style = BorderLineStyle.Solid
|
|
};
|
|
|
|
public static readonly RangeBorderStyle SilverSolid = new RangeBorderStyle
|
|
{
|
|
Color = Color.Silver,
|
|
Style = BorderLineStyle.Solid
|
|
};
|
|
|
|
public static readonly RangeBorderStyle BlackDotted = new RangeBorderStyle
|
|
{
|
|
Color = Color.Black,
|
|
Style = BorderLineStyle.Dotted
|
|
};
|
|
|
|
public static readonly RangeBorderStyle GrayDotted = new RangeBorderStyle
|
|
{
|
|
Color = Color.Gray,
|
|
Style = BorderLineStyle.Dotted
|
|
};
|
|
|
|
public static readonly RangeBorderStyle BlackDash = new RangeBorderStyle
|
|
{
|
|
Color = Color.Black,
|
|
Style = BorderLineStyle.Dashed
|
|
};
|
|
|
|
public static readonly RangeBorderStyle GrayDash = new RangeBorderStyle
|
|
{
|
|
Color = Color.Gray,
|
|
Style = BorderLineStyle.Dashed
|
|
};
|
|
}
|
|
}
|