wasStitchNET – Diff between revs 8 and 9

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 8 Rev 9
Line 4... Line 4...
4 // rights of fair usage, the disclaimer and warranty conditions. // 4 // rights of fair usage, the disclaimer and warranty conditions. //
5 /////////////////////////////////////////////////////////////////////////// 5 ///////////////////////////////////////////////////////////////////////////
6 // Based on: https://seattlesoftware.wordpress.com/2009/03/13/get-the-xpath-to-an-xml-element-xelement/ 6 // Based on: https://seattlesoftware.wordpress.com/2009/03/13/get-the-xpath-to-an-xml-element-xelement/
Line 7... Line 7...
7   7  
-   8 using System;
8 using System; 9 using System.Collections.Generic;
9 using System.Linq; 10 using System.Linq;
Line 10... Line 11...
10 using System.Xml.Linq; 11 using System.Xml.Linq;
11   12  
12 namespace wasStitchNET.Patchers 13 namespace wasStitchNET.Patchers
13 { 14 {
-   15 public static class Utilities
-   16 {
-   17 public static IEnumerable<XElement> ParentsAndSelf(this XElement e)
-   18 {
-   19 if (e == null)
-   20 yield break;
-   21  
-   22 yield return e;
-   23  
-   24 foreach (var p in ParentsAndSelf(e.Parent))
-   25 {
-   26 yield return p;
-   27 }
14 public static class Utilities 28 }
15 { 29  
16 /// <summary> 30 /// <summary>
17 /// Get the absolute XPath to a given XElement 31 /// Get the absolute XPath to a given XElement
18 /// (e.g. "/people/person[6]/name[1]/last[1]"). 32 /// (e.g. "/people/person[6]/name[1]/last[1]").