Show / Hide Table of Contents

Class Element

Represents an element to be drawn in a host control

Inheritance
System.Object
DisposableObject
Element
CandleBuySellView.CandleBuySellElement
CandleMidLineView.CandleMidLineElement
CandleView.CandleElement
SeriesView.YLevelElement
TimeScalePane.TimeCursorElement
CellElement
CheckableElement
PressableElement
RadioGroupElement
SymbolElement
TextElement
Implements
System.IDisposable
Inherited Members
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
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()
Namespace: NFX.WinForms.Elements
Assembly: NFX.WinForms.dll
Syntax
public abstract class Element : DisposableObject, IDisposable

Constructors

Element(ElementHostControl)

Declaration
protected Element(ElementHostControl host)
Parameters
Type Name Description
ElementHostControl host

Properties

DisplayRegion

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

Enabled

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
Type Description
IFieldControlContext

Height

Shortcut property to element's region

Declaration
public int Height { get; set; }
Property Value
Type Description
System.Int32

Host

References host control

Declaration
public ElementHostControl Host { get; }
Property Value
Type Description
ElementHostControl

Left

Shortcut property to element's region

Declaration
public int Left { get; set; }
Property Value
Type Description
System.Int32

MouseIsOver

Returns true if mouse is currently over the element

Declaration
public bool MouseIsOver { get; }
Property Value
Type Description
System.Boolean

MouseTransparent

Indicates whether an element does not receive any mouse events

Declaration
public bool MouseTransparent { get; set; }
Property Value
Type Description
System.Boolean

OwnedElements

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
Type Description
ElementList

Region

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

Tags

Declaration
public Dictionary<string, object> Tags { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.String, System.Object>

Top

Shortcut property to element's region

Declaration
public int Top { get; set; }
Property Value
Type Description
System.Int32

Visible

Indicates whether an element is displayed

Declaration
public bool Visible { get; set; }
Property Value
Type Description
System.Boolean

Width

Shortcut property to element's region

Declaration
public int Width { get; set; }
Property Value
Type Description
System.Int32

ZOrder

Indicates whether an element is displayed

Declaration
public int ZOrder { get; set; }
Property Value
Type Description
System.Int32

Methods

Destructor()

Declaration
protected override void Destructor()
Overrides
DisposableObject.Destructor()

EnabledChanged()

Override to take action after element's enabled state change

Declaration
protected virtual void EnabledChanged()

FieldControlContextChanged()

Declaration
protected virtual void FieldControlContextChanged()

Invalidate()

Invalidates space occupied by this element. This causes repaint of any elements overlapped by elements region

Declaration
public void Invalidate()

MouseTransparentChanged()

Override to take action after element's mouse transparency change

Declaration
protected virtual void MouseTransparentChanged()

OnMouseClick(MouseEventArgs)

Declaration
protected virtual void OnMouseClick(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseDoubleClick(MouseEventArgs)

Declaration
protected virtual void OnMouseDoubleClick(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseDown(MouseEventArgs)

Declaration
protected virtual void OnMouseDown(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseDrag(MouseEventArgs)

Declaration
protected virtual void OnMouseDrag(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseDragCancel(EventArgs)

Declaration
protected virtual void OnMouseDragCancel(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

OnMouseDragRelease(MouseEventArgs)

Declaration
protected virtual void OnMouseDragRelease(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseDragStart(MouseEventArgs)

Declaration
protected virtual void OnMouseDragStart(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseEnter(EventArgs)

Declaration
protected virtual void OnMouseEnter(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

OnMouseLeave(EventArgs)

Declaration
protected virtual void OnMouseLeave(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

OnMouseMove(MouseEventArgs)

Declaration
protected virtual void OnMouseMove(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseUp(MouseEventArgs)

Declaration
protected virtual void OnMouseUp(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

OnMouseWheel(MouseEventArgs)

Declaration
protected virtual void OnMouseWheel(MouseEventArgs e)
Parameters
Type Name Description
System.Windows.Forms.MouseEventArgs e

Paint(Graphics)

Declaration
protected virtual void Paint(Graphics gr)
Parameters
Type Name Description
System.Drawing.Graphics gr

RegionChanged()

Override to take action after element's region changed

Declaration
protected virtual void RegionChanged()

Repaint()

Repaints this particular element instance

Declaration
public void Repaint()

UpdateLocation(Int32, Int32)

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

VisibleChanged()

Override to take action after element's visibility change

Declaration
protected virtual void VisibleChanged()

ZOrderChanged()

Override to take action after element's Z-order changed

Declaration
protected virtual void ZOrderChanged()

Events

MouseClick

Declaration
public event MouseEventHandler MouseClick
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseDoubleClick

Declaration
public event MouseEventHandler MouseDoubleClick
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseDown

Declaration
public event MouseEventHandler MouseDown
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseDrag

Declaration
public event MouseEventHandler MouseDrag
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseDragCancel

Declaration
public event EventHandler MouseDragCancel
Event Type
Type Description
System.EventHandler

MouseDragRelease

Declaration
public event MouseEventHandler MouseDragRelease
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseDragStart

Declaration
public event MouseEventHandler MouseDragStart
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseEnter

Declaration
public event EventHandler MouseEnter
Event Type
Type Description
System.EventHandler

MouseLeave

Declaration
public event EventHandler MouseLeave
Event Type
Type Description
System.EventHandler

MouseMove

Declaration
public event MouseEventHandler MouseMove
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseUp

Declaration
public event MouseEventHandler MouseUp
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

MouseWheel

Declaration
public event MouseEventHandler MouseWheel
Event Type
Type Description
System.Windows.Forms.MouseEventHandler

Implements

System.IDisposable

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX