public static void Save(ScreenType item) { string ConfigPath = ConfigurationLoader.GetFileConfigurationPath(); string filePath = String.Format("{0}ScreenTypes\\{1}.xml", ConfigPath, item.Name); ConfigurationLoader.SerializeObjectToFile(item, filePath); }
public static ScreenType GetByName(string Name) { ScreenType item = Configuration.GetInstance().ScreenTypes .Where(i => ( (i.Name.ToLower() == Name.ToLower()) ) ) .SingleOrDefault(); return(item); }
public static ScreenType GetScreenType(Screen screen) { ScreenType screenType = Configuration.GetInstance().ScreenTypes .Where(s => ( (s.Name.ToLower() == screen.Type.ToLower()) ) ) .SingleOrDefault(); return(screenType); }
public static void Load(System.Xml.Linq.XDocument doc) { XmlSerializer serializer = new XmlSerializer(typeof(ScreenType)); XmlReader reader = doc.CreateReader(); reader.MoveToContent(); ScreenType item = null; try { item = (ScreenType)serializer.Deserialize(reader); } catch (Exception ex) { throw new ApplicationException(String.Format("Error occurred while processing {0}", doc.Root.FirstNode.ToString()), ex); } Configuration.GetInstance().ScreenTypes.Add(item); }