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

Commit 859a443

Browse files
committed
SvgDocument has TryFind (with bool result) and Find (with element result) new methods
1 parent b647089 commit 859a443

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace SharpDX.Direct2D1
7+
{
8+
public partial class SvgDocument
9+
{
10+
/// <summary>
11+
/// Finds an svg element by id
12+
/// </summary>
13+
/// <param name="id">Id to lookup for</param>
14+
/// <returns>SvgElement</returns>
15+
public SvgElement FindElementById(string id)
16+
{
17+
SharpDX.Result __result__;
18+
SvgElement svgElement;
19+
__result__ = TryFindElementById_(id, out svgElement);
20+
21+
__result__.CheckError();
22+
return svgElement;
23+
}
24+
25+
/// <summary>
26+
/// Try to find an element by id
27+
/// </summary>
28+
/// <param name="id">id to search for</param>
29+
/// <param name="svgElement">When this method completes, contains the relevant element (if applicable)</param>
30+
/// <returns>true if element has been found, false otherwise</returns>
31+
public bool TryFindElementById(string id, out SvgElement svgElement)
32+
{
33+
SharpDX.Result __result__;
34+
__result__ = TryFindElementById_(id, out svgElement);
35+
36+
return __result__.Code >= 0;
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)