Skip to content

Instantly share code, notes, and snippets.

@sgoguen
Created December 8, 2009 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgoguen/251693 to your computer and use it in GitHub Desktop.
Save sgoguen/251693 to your computer and use it in GitHub Desktop.
Public MustInherit Class LazyXMLBase
Implements IEnumerable(Of XNode)
Public MustOverride Function Render() As XNode
Public Function GetEnumerator() As System.Collections.Generic.IEnumerator(Of System.Xml.Linq.XNode) Implements System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XNode).GetEnumerator
Return Enumerable.Repeat(Me.Render(), 1).GetEnumerator()
End Function
Public Function GetEnumerator1() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
Return Me.GetEnumerator()
End Function
Public Overrides Function ToString() As String
Return Me.Render().ToString()
End Function
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment