ComponentAttributes

Attributes<1>References
[IoId("00000000-7F8D-414D-A22A-A287C2E2073F")] public class ComponentAttributes : Attributes<Component>, IResponsive
Class for all component attributes.

Constructors

ComponentAttributes

#
public ComponentAttributes(Component owner)
owner (Component)

Properties

AggregateBounds

public RectangleF AggregateBounds { get; }
Gets the aggregate bounds of this object. This will include the bounds of all objects attached in some way to this object.
inherited fromAttributes<T>
AggregateBounds

Bounds

public RectangleF Bounds { get; protected set; }
Gets the total outer bounds of the attributes. The attributes are assumed not to exist beyond this limit. Note that the bounds are updated during calls to Layout(), so may be out-of-date or even unset when called outside of the usual process.
inherited fromAttributes<T>
Bounds

CentralBox

#
public RectangleF CentralBox { get; protected set; }
Gets the bounds of the components central box. This box contains the component icon and possibly other elements such as the display name.

ContentBox

#
public RectangleF ContentBox { get; protected set; }
Gets the icon or name box.

IntegerPivot

protected virtual bool IntegerPivot { get; }
Gets whether the pivot of these attributes is always rounded to integer coordinates. By default this property returns true, as the vast majority of objects ought to be laid out in integer coordinates.
inherited fromAttributes<T>

LabelBox

#
public RectangleF LabelBox { get; protected set; }
Gets or sets the label box.

Owner

public T Owner { get; }
inherited fromAttributes<T>

Pivot

public PointF Pivot { get; set; }
Gets or sets the pivot point for these attributes. The pivot is the main point around which the attribute geometry is positioned during layout.
inherited fromAttributes<T>
Pivot

Responder

#
public Responses Responder { get; }
Gets the Responses dispatcher for these attributes. Subclasses can subscribe to the hook events on the returned object to extend interaction behaviour without subclassing the responder itself.
Responder

ShowTentativeInputs

#
public bool ShowTentativeInputs { get; set; }
Gets or sets whether the potential input grips are shown.

ShowTentativeOutputs

#
public bool ShowTentativeOutputs { get; set; }
Gets or sets whether the potential input grips are shown.

Snappable

public virtual bool Snappable { get; }
Gets whether these attributes can be used to align other objects on the canvas. Return false specifically when your object shape is not rectangular.
inherited fromAttributes<T>
Snappable

Stack

protected StackF Stack { get; set; }
The horizontal layout stack along the apex row. Derived classes typically (re)assign this during Attributes<T>.Layout(Shape) and reference sub-regions via class-local index constants. The default Attributes<T>.PivotMoved(PointF, PointF) translates the stack along with Attributes<T>.Bounds.
inherited fromAttributes<T>

TentativeInputs

#
public IEnumerable<TentativeGrip> TentativeInputs { get; }
Enumerate over all tentative input grips, provided they are being drawn.

TentativeOutputs

#
public IEnumerable<TentativeGrip> TentativeOutputs { get; }
Enumerate over all tentative output grips, provided they are being drawn.

Methods

DefaultTooltipContent

protected bool DefaultTooltipContent(PointF point, out IIcon icon, out string caption, out string message, out object details, out bool warnings, out bool errors)
Create the tooltip fields which are associated with this object by default.
inherited fromAttributes<T>
point (PointF)Point for tooltip.
icon (out IIcon)Icon.
caption (out string)Caption text.
message (out string)Message text.
details (out object)Either text or an Action<Context, Rectangle> or null.
warnings (out bool)Boolean flag indicating the existence of warnings.
errors (out bool)Boolean flag indicating the existence of errors.
True if a tooltip ought to be shown for this object at the given location.

Draw

#
protected sealed override void Draw(Context context, Skin skin, Capsule capsule)
Internal drawing method. Consider overriding this one instead of Draw.
context (Context)Graphics context.
skin (Skin)Skin.
capsule (Capsule)Provided as a courtesy. There is no expectation this is the shape that must be drawn.

Draw

public virtual void Draw(Context context, Skin skin)
Render the owner object of these attributes.
inherited fromAttributes<T>
context (Context)Drawing context.
skin (Skin)Object skin.
Draw

DrawBackground

#
protected virtual void DrawBackground(Context context, Skin skin, Capsule capsule, Shade shade)
Draw the capsule background.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

DrawContent

#
protected virtual void DrawContent(Context context, Skin skin, Capsule capsule, Shade shade)
The code which decides whether to draw the icon or the name. Override this method to always draw one or the other.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

DrawForeground

#
protected virtual void DrawForeground(Context context, Skin skin, Capsule capsule, Shade shade)
Draw the capsule overlay and foreground.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

DrawForegroundDecorations

#
protected virtual void DrawForegroundDecorations(Context context, Skin skin, Capsule capsule, Shade shade)
Override this method to draw capsule decorations immediately after the capsule foreground is drawn, but before the tentative grips and variable parameter zui is drawn.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

DrawIcon

#
protected virtual void DrawIcon(Context context, Skin skin, Capsule capsule, Shade shade)
Draw the component icon.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

DrawInputs

#
protected virtual void DrawInputs(Context context, Skin skin)
Draw the input parameters.
context (Context)
skin (Skin)

DrawLabel

#
protected virtual void DrawLabel(Context context, Skin skin, Capsule capsule, Shade shade)
Draw the component label text.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

DrawName

#
protected virtual void DrawName(Context context, Skin skin, Capsule capsule, Shade shade)
Draw the component name.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

DrawOutputs

#
protected virtual void DrawOutputs(Context context, Skin skin)
Draw the output parameters.
context (Context)
skin (Skin)

DrawUserName

#
protected virtual void DrawUserName(Context context, Skin skin, Capsule capsule, Shade shade)
Draw the user name above or below the component capsule.
context (Context)
skin (Skin)
capsule (Capsule)
shade (Shade)

HandleDoubleClick

public virtual bool HandleDoubleClick(PointF point)
Handle a double click operation on these attributes. Since this is such a common operation it is provided by the base interface, rather than requiring an IResponseAttribues implementation.
inherited fromAttributes<T>
point (PointF)
HandleDoubleClick

Intersects

public virtual bool Intersects(RectangleF box)
Test whether a given rectangle intersects the shape of these attributes.
inherited fromAttributes<T>
box (RectangleF)Intersection box.
True if rectangle intersects these attributes.
Intersects

InvalidateDisplay

public virtual void InvalidateDisplay()
Signals that the attribute's visual appearance has changed without affecting layout. Fires the owner's DocumentObject.OnDisplayChanged(), which propagates through the document to the canvas redraw subscription.
inherited fromAttributes<T>
InvalidateDisplay

InvalidateLayout

#
public override void InvalidateLayout()
Marks the layout as dirty so it gets recomputed on the next draw cycle. Subclasses typically flip an internal _layoutValid flag. Most callers should also raise OnLayoutChanged on the owner to actually trigger a canvas redraw.

IsCoincident

public virtual bool IsCoincident(PointF point)
Test whether a given point is considered to be on the interior of these attributes.
inherited fromAttributes<T>
point (PointF)Test point.
True if point is on the object.
IsCoincident

IsContained

public virtual bool IsContained(RectangleF box)
Test whether the shape of these attributes is fully contained within a given rectangle.
inherited fromAttributes<T>
box (RectangleF)Containment box.
True if rectangle contains these attributes.
IsContained

Layout

#
public override void Layout(Shape shape)
shape (Shape)

LayoutBounds

#
protected virtual void LayoutBounds(Shape shape)
Layout the outer bounds of the component capsule and assign the result to the Bounds property. This is the last sub-layout method to be called during component layout.
shape (Shape)

LayoutCentralBox

#
protected void LayoutCentralBox(Font font, int inputCount, int outputCount)
Central box layout code with input/output parameter overrides.
font (Font)
inputCount (int)
outputCount (int)

LayoutCentralBox

#
protected virtual void LayoutCentralBox(Font font)
Layout the central component box and assign the CentralBox and ContentBox properties. This is the first sub-layout method to be called during component layout. If you wish to reserve additional space within the component attributes, override this method and modify either the CentralBox or ContentBox properties or both after calling the base class method.
font (Font)

LayoutInputParameters

#
protected void LayoutInputParameters(Font font, IEnumerable<IParameter> inputs, int inputCount)
Input parameter layout with parameter override.
font (Font)
inputs (IEnumerable<IParameter>)
inputCount (int)

LayoutInputParameters

#
protected virtual void LayoutInputParameters(Font font)
Perform layout on all input parameters and assign their respective attribute properties. This method will only affect inputs with attributes of type 'InputParameterAttributes'. This method must be called *after* LayoutCentralBox.
font (Font)

LayoutOutputParameters

#
protected void LayoutOutputParameters(Font font, IEnumerable<IParameter> outputs, int outputCount)
Default output layout with parameter list override.
font (Font)
outputs (IEnumerable<IParameter>)
outputCount (int)

LayoutOutputParameters

#
protected virtual void LayoutOutputParameters(Font font)
Perform layout on all output parameters and assign their respective attribute properties. This method will only affect outputs with attributes of type 'OutputParameterAttributes'. This method must be called *after* LayoutCentralBox.
font (Font)

Move

public virtual void Move(float dx, float dy)
Move these attributes a certain amount in X and Y.
inherited fromAttributes<T>
dx (float)Motion in X. Positive is towards the right.
dy (float)Motion in Y. Positive is downwards.
Move

PivotMoved

#
protected override void PivotMoved(PointF oldPivot, PointF newPivot)
oldPivot (PointF)
newPivot (PointF)

PreDrawAddInputGrips

#
protected virtual void PreDrawAddInputGrips(Capsule capsule)
Adds the left-hand grips to the input parameters.
capsule (Capsule)

PreDrawAddOutputGrips

#
protected virtual void PreDrawAddOutputGrips(Capsule capsule)
Adds the right-hand grips to the output parameters.
capsule (Capsule)

ShowTooltipAt

#
public override bool ShowTooltipAt(PointF point)
point (PointF)

TooltipDetails

protected virtual object TooltipDetails(PointF point, ObjectSolutionState state)
Override this method to return custom details for a tooltip.
inherited fromAttributes<T>
point (PointF)
state (ObjectSolutionState)
One of the acceptable types of data for details. For example an array of LazyStrings or a Action<Context, RectangleF>.