public static BindingList <FileFormatClass> FileFormats() { BindingList <FileFormatClass> ocConversionRules = new BindingList <FileFormatClass>(); // Execute the query using the LINQ to XML var rules = from c in XElement.Load(XMLBuilder.FileFormatXml()).Elements("Format") select c; foreach (var rule in rules) { FileFormatClass cRule = new FileFormatClass() { Format = rule.Element("Name").Value, Description = rule.Element("Description").Value }; ocConversionRules.Add(cRule); } return(ocConversionRules); }
public static BindingList <ConversionClass> ConversionRules() { BindingList <ConversionClass> ocConversionRules = new BindingList <ConversionClass>(); // Execute the query using the LINQ to XML var rules = from c in XElement.Load(XMLBuilder.ConversionRuleXml()).Elements("Conversion") select c; foreach (var rule in rules) { ConversionClass cRule = new ConversionClass() { SourceFormat = rule.Element("Source").Value, TargetFormat = rule.Element("Target").Value, IsDefault = true, IsOverridden = false }; ocConversionRules.Add(cRule); } return(ocConversionRules); }