1using System.Threading.Tasks;
21 : base(Document, Parent)
36 set => this.color = value;
43 public override Task
FromXml(XmlElement Input)
46 return base.FromXml(Input);
55 base.ExportAttributes(Output);
57 this.color?.
Export(Output);
68 return new SolidPen(Document, Parent);
77 base.CopyContents(Destination);
90 await base.DoMeasureDimensions(State);
92 if (this.
paint is
null)
97 this.paint =
new SKPaint()
99 FilterQuality = SKFilterQuality.High,
101 Style = SKPaintStyle.Stroke,
106 this.paint.StrokeWidth = this.
penWidth.Value;
109 this.paint.StrokeCap = this.
penCap.Value;
112 this.paint.StrokeJoin = this.
penJoin.Value;
115 this.paint.StrokeMiter = this.
penMiter.Value;
128 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.
ColorAttribute 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.
Variables Session
Current session.
Layout2DDocument Document
Layout document.
Abstract base class for pens.
SKStrokeCap? penCap
Measured pen stroke cap.
SKStrokeJoin? penJoin
Measured pen stroke join.
float? penWidth
Measured pen width.
float? penMiter
Measured pen miter.
override string LocalName
Local name of type of element.
override void CopyContents(ILayoutElement Destination)
Copies contents (attributes and children) to the destination element.
override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
Creates a new instance of the layout element.
override void ExportStateAttributes(XmlWriter Output)
Exports the local attributes of the current element.
override void ExportAttributes(XmlWriter Output)
Exports attributes to XML.
override async Task DoMeasureDimensions(DrawingState State)
Measures layout entities and defines unassigned properties, related to dimensions.
SolidPen(Layout2DDocument Document, ILayoutElement Parent)
A solid pen
override Task FromXml(XmlElement Input)
Populates the element (including children) with information from its XML definition.
Base interface for all layout elements.
Layout2DDocument Document
Layout document.