public static XmlModuleEntryList GetModuleEntryList(this DTE dte) { XmlModuleEntryList moduleEntryList = null; var text = dte.GetActiveDocumentText(); XElement factonModules = XDocument.Parse(text).Descendants().FirstOrDefault(p => p.Name.LocalName == "factonModules"); XElement factonBootstrapper = XDocument.Parse(text).Descendants().FirstOrDefault(p => p.Name.LocalName == "factonBootstrapper"); if (factonBootstrapper != null) { IEnumerable <XElement> entries = factonBootstrapper.Descendants().Where(p => p.Name.LocalName == "entry"); } if (factonModules != null) { moduleEntryList = factonModules.ToString().Deserialize <XmlModuleEntryList>(); } return(moduleEntryList); }
public static T Deserialize <T>(this DTE dte) { var txt = dte.GetActiveDocumentText(); return(txt.Deserialize <T>()); }