2using System.Threading.Tasks;
30 : base(Document, Parent)
41 this.paint?.Dispose();
48 public SKPaint
Paint => this.paint;
56 set => this.width = value;
65 set => this.cap = value;
74 set => this.join = value;
83 set => this.miter = value;
90 public override Task
FromXml(XmlElement Input)
97 return base.FromXml(Input);
106 base.ExportAttributes(Output);
108 this.width?.
Export(Output);
110 this.join?.
Export(Output);
111 this.miter?.
Export(Output);
120 base.CopyContents(Destination);
122 if (Destination is
Pen Dest)
138 await base.DoMeasureDimensions(State);
144 a = this.penWidth ?? 0;
149 this.penWidth =
null;
159 this.penJoin = Join.
Result;
166 a = this.penMiter ?? 0;
171 this.penMiter =
null;
200 base.ExportStateAttributes(Output);
Contains a 2D layout document.
void Export(XmlWriter Output)
Exports the attribute.
void ExportState(XmlWriter Output)
Exports the state of the attribute.
static async Task< EvaluationResult< T > > TryEvaluate(Attribute< T > Attribute, Variables Session)
Tries to evaluate the attribute value.
EnumAttribute< TEnum > CopyIfNotPreset(Layout2DDocument ForDocument)
Copies the attribute object if undefined, or defined by an expression. Returns a reference to itself,...
Result of asynchronous evaluation.
T Result
Evaluated result, if successful.
bool Ok
If evaluation was successful.
LengthAttribute CopyIfNotPreset(Layout2DDocument ForDocument)
Copies the attribute object if undefined, or defined by an expression. Returns a reference to itself,...
Variables Session
Current session.
void CalcDrawingSize(Length L, ref float Size, bool Horizontal, ILayoutElement Element)
Converts a defined length to drawing size.
Abstract base class for layout elements.
Layout2DDocument Document
Layout document.
Abstract base class for pens.
override void ExportAttributes(XmlWriter Output)
Exports attributes to XML.
override void CopyContents(ILayoutElement Destination)
Copies contents (attributes and children) to the destination element.
EnumAttribute< SKStrokeJoin > JoinAttribute
Join
SKStrokeCap? penCap
Measured pen stroke cap.
SKStrokeJoin? penJoin
Measured pen stroke join.
LengthAttribute WidthAttribute
Width
float? penWidth
Measured pen width.
Pen(Layout2DDocument Document, ILayoutElement Parent)
Abstract base class for pens.
override async Task DoMeasureDimensions(DrawingState State)
Measures layout entities and defines unassigned properties, related to dimensions.
override void ExportStateAttributes(XmlWriter Output)
Exports the local attributes of the current element.
override void Dispose()
IDisposable.Dispose
EnumAttribute< SKStrokeCap > CapAttribute
Cap
override Task FromXml(XmlElement Input)
Populates the element (including children) with information from its XML definition.
LengthAttribute MiterAttribute
Miter
float? penMiter
Measured pen miter.
Base interface for all layout elements.
Layout2DDocument Document
Layout document.