Class Element
Represents an element to be drawn in a host control
Inheritance
System.Object
Element
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Azos.WinForms.dll
public abstract class Element : DisposableObject, IDisposable
Constructors
Declaration
protected Element(ElementHostControl host)
Parameters
Properties
Provides graphical region- coordinates of the element in zoomed container. These coordinates are different from Region when Zoom!=1
because Region returns "normal"/non-zoomed coordinates. Mouse event handlers must use DisplayRegion because mouse is in screen coordinates
Declaration
public Rectangle DisplayRegion { get; }
Property Value
Type |
Description |
System.Drawing.Rectangle |
|
Indicates whether an element can receive events
Declaration
public bool Enabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
FieldControlContext
References control context for which element painting is done, may be null.
Part renderers may need control context to paint additional features like changed borders (when mofified etc.).
Declaration
public IFieldControlContext FieldControlContext { get; set; }
Property Value
Shortcut property to element's region
Declaration
public int Height { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Declaration
public ElementHostControl Host { get; }
Property Value
Shortcut property to element's region
Declaration
public int Left { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Returns true if mouse is currently over the element
Declaration
public bool MouseIsOver { get; }
Property Value
Type |
Description |
System.Boolean |
|
Indicates whether an element does not receive any mouse events
Declaration
public bool MouseTransparent { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Returns a list of elements owned by this element. Owned elements are deleted when this element is deleted.
Element ownership does not affect element drawing
Declaration
public ElementList OwnedElements { get; }
Property Value
Provides graphical region- coordinates of the element without zoom. Even when host container is zoomed it has no effect on Region. Compare to DisplayRegion
Declaration
public Rectangle Region { get; set; }
Property Value
Type |
Description |
System.Drawing.Rectangle |
|
Declaration
public Dictionary<string, object> Tags { get; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
Shortcut property to element's region
Declaration
public int Top { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Indicates whether an element is displayed
Declaration
public bool Visible { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Shortcut property to element's region
Declaration
public int Width { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Indicates whether an element is displayed
Declaration
public int ZOrder { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
Declaration
protected override void Destructor()
Overrides
Override to take action after element's enabled state change
Declaration
protected virtual void EnabledChanged()
FieldControlContextChanged()
Declaration
protected virtual void FieldControlContextChanged()
Invalidates space occupied by this element.
This causes repaint of any elements overlapped by elements region
Declaration
Override to take action after element's mouse transparency change
Declaration
protected virtual void MouseTransparentChanged()
Declaration
protected virtual void OnMouseClick(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseDoubleClick(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseDown(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseDrag(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseDragCancel(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected virtual void OnMouseDragRelease(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseDragStart(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseEnter(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected virtual void OnMouseLeave(EventArgs e)
Parameters
Type |
Name |
Description |
System.EventArgs |
e |
|
Declaration
protected virtual void OnMouseMove(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseUp(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void OnMouseWheel(MouseEventArgs e)
Parameters
Type |
Name |
Description |
System.Windows.Forms.MouseEventArgs |
e |
|
Declaration
protected virtual void Paint(Graphics gr)
Parameters
Type |
Name |
Description |
System.Drawing.Graphics |
gr |
|
Override to take action after element's region changed
Declaration
protected virtual void RegionChanged()
Repaints this particular element instance
Declaration
Updates element location by delta x/y without causing invalidate
Declaration
public void UpdateLocation(int dx, int dy)
Parameters
Type |
Name |
Description |
System.Int32 |
dx |
|
System.Int32 |
dy |
|
Override to take action after element's visibility change
Declaration
protected virtual void VisibleChanged()
Override to take action after element's Z-order changed
Declaration
protected virtual void ZOrderChanged()
Events
Declaration
public event MouseEventHandler MouseClick
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event MouseEventHandler MouseDoubleClick
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event MouseEventHandler MouseDown
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event MouseEventHandler MouseDrag
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event EventHandler MouseDragCancel
Event Type
Type |
Description |
System.EventHandler |
|
Declaration
public event MouseEventHandler MouseDragRelease
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event MouseEventHandler MouseDragStart
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event EventHandler MouseEnter
Event Type
Type |
Description |
System.EventHandler |
|
Declaration
public event EventHandler MouseLeave
Event Type
Type |
Description |
System.EventHandler |
|
Declaration
public event MouseEventHandler MouseMove
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event MouseEventHandler MouseUp
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Declaration
public event MouseEventHandler MouseWheel
Event Type
Type |
Description |
System.Windows.Forms.MouseEventHandler |
|
Implements
System.IDisposable
Extension Methods