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 an instance of the class.
protected Border()
Border(Border)
Initializes an instance of the class.
protected Border(Border copyFrom)
| Parameter | Type | Description |
|---|---|---|
| copyFrom | Border | An instance of Border which will be copied to initialize the new instance. |
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 object to compare with the current object. |
Returns
- bool:
trueif the specified object is equal to the current object; otherwise,false.
GetBorderWidth()
The width of the border.
GetHashCode()
Serves as the default hash function.
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 = Sides.All)
| 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
boundsoffset 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 | The event data. |
Events
PropertyChanged
Occurs after a property is changed.
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)