public static void Save(SectionZoneLayout item) { string ConfigPath = ConfigurationLoader.GetFileConfigurationPath(); if (!Directory.Exists(String.Format("{0}SectionZoneLayouts", ConfigPath))) { Directory.CreateDirectory(String.Format("{0}SectionZoneLayouts", ConfigPath)); } string filePath = String.Format("{0}SectionZoneLayouts\\{1}.xml", ConfigPath, item.Name); ConfigurationLoader.SerializeObjectToFile(item, filePath); }
public static SectionZoneLayout GetByName(string Name) { SectionZoneLayout item = null; if (!String.IsNullOrEmpty(Name)) { item = Configuration.GetInstance().SectionZoneLayouts .Where(i => ( (i.Name.ToLower() == Name.ToLower()) ) ) .SingleOrDefault(); } return(item); }
public static void Load(XDocument doc) { XmlSerializer serializer = new XmlSerializer(typeof(SectionZoneLayout)); XmlReader reader = doc.CreateReader(); reader.MoveToContent(); SectionZoneLayout item = null; try { item = (SectionZoneLayout)serializer.Deserialize(reader); } catch (Exception ex) { throw new ApplicationException(String.Format("Error occurred while processing SectionZoneLayout - {0}", doc.Root.FirstNode.ToString()), ex); } Configuration.GetInstance().SectionZoneLayouts.Add(item); }