Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 14ce60b

Browse files
committed
Add tag name property on svg element
1 parent ea817cf commit 14ce60b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Source/SharpDX.Direct2D1/SvgElement.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Text;
55

66
using SharpDX.Mathematics.Interop;
7+
using System.Runtime.InteropServices;
78

89
namespace SharpDX.Direct2D1
910
{
@@ -45,6 +46,21 @@ public SvgElement[] Children
4546
}
4647
}
4748

49+
/// <summary>
50+
/// Gets tag name for this element
51+
/// </summary>
52+
public unsafe string TagName
53+
{
54+
get
55+
{
56+
int nameLength = GetTagNameLength();
57+
sbyte* name = stackalloc sbyte[nameLength];
58+
59+
GetTagName(new IntPtr(name), nameLength + 1);
60+
return Marshal.PtrToStringUni((IntPtr)name, nameLength);
61+
}
62+
}
63+
4864
/// <summary>
4965
/// Sets float attribute
5066
/// </summary>

0 commit comments

Comments
 (0)