Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }