Border Class
Provides a base class for an object that can be used as a border.
[TypeConverter(typeof(GenericExpandableNullableObjectConverter))]
public abstract class Border : ICloneable
- Inheritance:
- object object
- Derived:
- SimpleBorder
- Implements:
- ICloneable
Constructors
Border()
Initializes a new instance of the Border
class.
protected Border()
Remarks
The default constructor initializes all fields to their default values.
Border(Border)
Initializes a new instance of the Border
class.
protected Border(Border copyFrom)
Parameter | Type | Description |
---|---|---|
copyFrom | Border | An instance of |
Remarks
This constructor used in support of Clone() for base classes to initialize their fields.
Methods
Clone()
Creates an exact duplicate of the Border object.
Draw(Graphics, Rectangle)
Draws the border on all sides.
public virtual void Draw(Graphics g, Rectangle bounds)
Parameter | Type | Description |
---|---|---|
g | Graphics | The |
bounds | Rectangle | The bounds of the area to paint. |
Draw(Graphics, Rectangle, Sides)
Draws the border.
public abstract 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. |
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.
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.
GetInnerBounds(Graphics, Rectangle)
Returns the area inside the given bounds
after the border
has been applied to all sides.
public virtual Rectangle GetInnerBounds(Graphics g, Rectangle bounds)
Parameter | Type | Description |
---|---|---|
g | Graphics | The |
bounds | Rectangle | The bounds where the border would be rendered. |
Returns
- Rectangle:
The original
bounds
offset and size-adjusted to compensate for the borders.
GetInnerBounds(Graphics, Rectangle, Sides)
Returns the area inside the given bounds
after the border
has been applied to the given sides
.
public virtual Rectangle GetInnerBounds(Graphics g, Rectangle bounds, Sides sides)
Parameter | Type | Description |
---|---|---|
g | Graphics | The |
bounds | Rectangle | The bounds where the border would be rendered. |
sides | Sides | The sides of the border that would be rendered. |
Returns
- Rectangle:
The original
bounds
offset and size-adjusted to compensate for the borders.
GetPrimaryColor()
Returns the primary Color
of the border.
OnPropertyChanged(EventArgs)
Raises the PropertyChanged
event.
protected virtual void OnPropertyChanged(EventArgs e)
Parameter | Type | Description |
---|---|---|
e | EventArgs | An |
Events
PropertyChanged
Occurs after a property is changed.