source: OniSplit/Metadata/XmlReaderExtensions.cs@ 1115

Last change on this file since 1115 was 1114, checked in by iritscen, 5 years ago

Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File size: 526 bytes
Line 
1using System.Xml;
2
3namespace Oni.Metadata
4{
5 internal static class XmlReaderExtensions
6 {
7 public static T ReadElementContentAsEnum<T>(this XmlReader xml) where T : struct
8 {
9 return Metadata.MetaEnum.Parse<T>(xml.ReadElementContentAsString());
10 }
11
12 public static T ReadElementContentAsEnum<T>(this XmlReader xml, string name) where T : struct
13 {
14 return Metadata.MetaEnum.Parse<T>(xml.ReadElementContentAsString(name, ""));
15 }
16 }
17}
Note: See TracBrowser for help on using the repository browser.