SimpleBorder Class
Provides a class that draws a simple border.
[TypeConverter(typeof(SimpleBorderConverter))]
public class SimpleBorder : Border, ICloneable
- Implements:
- ICloneable
Constructors
SimpleBorder()
Initializes a new instance of the SimpleBorder
class.
public SimpleBorder()
Remarks
The default constructor initializes all fields to their default values.
SimpleBorder(SimpleBorder)
Initializes a new instance of the SimpleBorder
class.
protected SimpleBorder(SimpleBorder copyFrom)
Parameter | Type | Description |
---|---|---|
copyFrom | SimpleBorder | An instance of |
Remarks
This constructor used in support of Clone() for base classes to initialize their fields.
SimpleBorder(SimpleBorderStyle, Color)
Initializes a new instance of the SimpleBorder
class.
public SimpleBorder(SimpleBorderStyle style, Color color)
Parameter | Type | Description |
---|---|---|
style | SimpleBorderStyle | The SimpleBorderStyle specifying the border type. |
color | Color | The base Color of the border. |
Properties
Color
Gets or sets the base color of the border.
public Color Color { get; set; }
Property Value
ColorAlpha
Gets or sets the color alpha value.
Style
Gets or sets the style of the border.
public SimpleBorderStyle Style { get; set; }
Property Value
- SimpleBorderStyle:
A SimpleBorderStyle object specifying the border style.
Methods
Clone()
Creates an exact duplicate of the Border object.
Draw(Graphics, Rectangle, Sides)
Draws the border.
public override void Draw(Graphics g, Rectangle bounds, Sides sides)
Parameter | Type | Description |
---|---|---|
g | Graphics | The |
bounds | Rectangle | The bounds of the area to paint. |
sides | Sides | The Sides of the border to draw. |
Draw(Graphics, Rectangle, SimpleBorderStyle, Color)
Draws a border.
public static void Draw(Graphics g, Rectangle bounds, SimpleBorderStyle borderStyle, Color borderColor)
Parameter | Type | Description |
---|---|---|
g | Graphics | The |
bounds | Rectangle | The bounds of the border. |
borderStyle | SimpleBorderStyle | The SimpleBorderStyle specifying the border type. |
borderColor | Color | The base Color of the border. |
Draw(Graphics, Rectangle, SimpleBorderStyle, Color, Sides)
Draws a border.
public static void Draw(Graphics g, Rectangle bounds, SimpleBorderStyle borderStyle, Color borderColor, Sides sides)
Parameter | Type | Description |
---|---|---|
g | Graphics | The |
bounds | Rectangle | The bounds of the border. |
borderStyle | SimpleBorderStyle | The SimpleBorderStyle specifying the border type. |
borderColor | Color | The base Color of the border. |
sides | Sides | The Sides of the border to draw. |
Equals(object)
Determines whether the specified Object
is equal to the current Object
.
public override bool Equals(object obj)
Parameter | Type | Description |
---|---|---|
obj | object | The |
Returns
- bool:
true
if the specifiedObject
is equal to the currentObject
; otherwise,false
.
GetBorderWidth()
Returns the width of the border.
GetBorderWidth(SimpleBorderStyle)
Returns the width of the border for the specified SimpleBorderStyle.
public static int GetBorderWidth(SimpleBorderStyle borderStyle)
Parameter | Type | Description |
---|---|---|
borderStyle | SimpleBorderStyle | A SimpleBorderStyle specifying the type of border to measure. |
Returns
- int:
The width of the border for the specified SimpleBorderStyle.
GetHashCode()
Returns a hash code for this object.
public override int GetHashCode()
Returns
- int:
An integer value that specifies a hash value for this object.
GetPrimaryColor()
Returns the primary Color
of the border.
ResetColor()
Resets the Color property to its default value.
public virtual void ResetColor()
ResetStyle()
Resets the Style property to its default value.
public virtual void ResetStyle()
ShouldSerializeColor()
Indicates whether the Color property should be persisted.
public virtual bool ShouldSerializeColor()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeStyle()
Indicates whether the Style property should be persisted.
public virtual bool ShouldSerializeStyle()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
Inherited Members
- Border.Draw(Graphics, Rectangle)
- Border.GetInnerBounds(Graphics, Rectangle)
- Border.GetInnerBounds(Graphics, Rectangle, Sides)
- Border.OnPropertyChanged(EventArgs)
- Border.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)