コード例 #1
0
 IEnumerable <T> Xml.Schema.Linq.IXTyped.Ancestors <T>()
 {
     for (XTypedElement i = this.getTypedParent(); i != null; i = i.getTypedParent())
     {
         T t = (T)(i as T);
         if (t != null)
         {
             yield return(t);
         }
     }
 }
コード例 #2
0
        IEnumerable <T> IXTyped.Ancestors <T>()
        {
            XTypedElement parent = getTypedParent();

            while (parent != null)
            {
                T parentT = parent as T;
                if (parentT != null)
                {
                    yield return(parentT);
                }
                parent = parent.getTypedParent();
            }
        }