Skip to content

Commit 2ddd52a

Browse files
feat: Turtle.get/set_TextAttribute ( Fixes #168 )
1 parent 222873d commit 2ddd52a

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Types/Turtle/get_TextAttribute.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<#
2+
.SYNOPSIS
3+
Gets any Text Attributes
4+
.DESCRIPTION
5+
Gets any attributes associated with the Turtle text
6+
7+
#>
8+
if (-not $this.'.TextAttribute') {
9+
$this | Add-Member NoteProperty '.TextAttribute' ([Ordered]@{}) -Force
10+
}
11+
return $this.'.TextAttribute'

Types/Turtle/set_TextAttribute.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<#
2+
.SYNOPSIS
3+
Sets text attributes
4+
.DESCRIPTION
5+
Sets any attributes associated with the turtle text.
6+
7+
These will become the attributes on the `<text>` element.
8+
#>
9+
param(
10+
# The text attributes.
11+
[Collections.IDictionary]
12+
$TextAttribute = [Ordered]@{}
13+
)
14+
15+
if (-not $this.'.TextAttribute') {
16+
$this | Add-Member -MemberType NoteProperty -Name '.TextAttribute' -Value ([Ordered]@{}) -Force
17+
}
18+
foreach ($key in $TextAttribute.Keys) {
19+
$this.'.TextAttribute'[$key] = $TextAttribute[$key]
20+
}

0 commit comments

Comments
 (0)