Custom attributes for AiComponent. Routes a double-click on the component body to the prompt-and-conversation flow.

Constructors

AiComponentAttributes

#
public AiComponentAttributes()

Properties

AggregateBounds

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

Bounds

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.
public RectangleF Bounds { get; protected set; }
inherited fromAttributes<T>
Bounds

CentralBox

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

ContentBox

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

IntegerPivot

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.
protected virtual bool IntegerPivot { get; }
inherited fromAttributes<T>

LabelBox

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

Owner

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

Pivot

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

Responder

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.
public Responses Responder { get; }
inherited fromComponentAttributes
Responder

ShowTentativeInputs

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

ShowTentativeOutputs

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

Snappable

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

Stack

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.
protected StackF Stack { get; set; }
inherited fromAttributes<T>

TentativeInputs

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

TentativeOutputs

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

Methods

DefaultTooltipContent

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

Draw

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

Draw

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

DrawBackground

#
protected override void DrawBackground(
context,
skin,
capsule,
shade
)

DrawContent

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

DrawForeground

Draw the capsule overlay and foreground.
protected virtual void DrawForeground(
context,
skin,
capsule,
shade
)
inherited fromComponentAttributes

DrawForegroundDecorations

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.
protected virtual void DrawForegroundDecorations(
context,
skin,
capsule,
shade
)
inherited fromComponentAttributes

DrawIcon

#
protected override void DrawIcon(
context,
skin,
capsule,
shade
)

DrawInputs

Draw the input parameters.
protected virtual void DrawInputs(
context,
skin
)
inherited fromComponentAttributes

DrawLabel

Draw the component label text.
protected virtual void DrawLabel(
context,
skin,
capsule,
shade
)
inherited fromComponentAttributes

DrawName

Draw the component name.
protected virtual void DrawName(
context,
skin,
capsule,
shade
)
inherited fromComponentAttributes

DrawOutputs

Draw the output parameters.
protected virtual void DrawOutputs(
context,
skin
)
inherited fromComponentAttributes

DrawUserName

Draw the user name above or below the component capsule.
protected virtual void DrawUserName(
context,
skin,
capsule,
shade
)
inherited fromComponentAttributes

HandleDoubleClick

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.
public virtual bool HandleDoubleClick(
PointF
point
)
inherited fromAttributes<T>
HandleDoubleClick

Intersects

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

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.
public virtual void InvalidateDisplay()
inherited fromAttributes<T>
InvalidateDisplay

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.
public override void InvalidateLayout()
inherited fromComponentAttributes

IsCoincident

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

IsContained

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

Layout

public override void Layout(
Shape
shape
)
inherited fromComponentAttributes

LayoutBounds

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.
protected virtual void LayoutBounds(
Shape
shape
)
inherited fromComponentAttributes

LayoutCentralBox

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

LayoutCentralBox

Layout the central component box and assign the ComponentAttributes.CentralBox and ComponentAttributes.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 ComponentAttributes.CentralBox or ComponentAttributes.ContentBox properties or both after calling the base class method.
protected virtual void LayoutCentralBox(
Font
font
)
inherited fromComponentAttributes

LayoutInputParameters

Input parameter layout with parameter override.
protected void LayoutInputParameters(
Font
font,
inputs,
inputCount
)
inherited fromComponentAttributes

LayoutInputParameters

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.
protected virtual void LayoutInputParameters(
Font
font
)
inherited fromComponentAttributes

LayoutOutputParameters

Default output layout with parameter list override.
protected void LayoutOutputParameters(
Font
font,
outputs,
outputCount
)
inherited fromComponentAttributes

LayoutOutputParameters

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.
protected virtual void LayoutOutputParameters(
Font
font
)
inherited fromComponentAttributes

Move

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

PivotMoved

protected override void PivotMoved(
PointF
oldPivot,
PointF
newPivot
)
inherited fromComponentAttributes

PreDrawAddInputGrips

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

PreDrawAddOutputGrips

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

ShowTooltipAt

public override bool ShowTooltipAt(
PointF
point
)
inherited fromComponentAttributes

TooltipDetails

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