Esempio n. 1
0
        public static MobileTabbedScreen Load(XDocument doc)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(MobileTabbedScreen));

            XmlReader reader = doc.CreateReader();

            reader.MoveToContent();

            MobileTabbedScreen screen = null;

            try
            {
                screen = (MobileTabbedScreen)serializer.Deserialize(reader);



                Configuration.GetInstance().MobileScreens.Add(screen);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("Error occurred while processing Screen - {0}", doc.Root.FirstNode.ToString()), ex);
            }

            return(screen);
        }
Esempio n. 2
0
        public static MobileScreen Load(string Name)
        {
            MobileScreen retVal = null;
            string       item   = String.Format("{0}.{1}.{2}.xml", ConfigurationLoader.ConfigAssemblyName, "MobileScreens", Name);

            using (Stream fileStream = ConfigurationLoader.ConfigAssembly.GetManifestResourceStream(item))
            {
                using (XmlReader xreader = XmlReader.Create(fileStream))
                {
                    XDocument doc      = XDocument.Load(xreader);
                    string    pageType = doc.Root.Element("Type").Value.ToLower();

                    switch (pageType)
                    {
                    case "mobilecontent":
                        retVal = MobileContentScreen.Load(doc);
                        break;

                    case "mobilenavigation":
                        retVal = MobileNavigationScreen.Load(doc);
                        break;

                    case "mobiletabbed":
                        retVal = MobileTabbedScreen.Load(doc);
                        break;

                    default:
                        retVal = MobileContentScreen.Load(doc);
                        break;
                    }
                }
            }

            return(retVal);
        }
Esempio n. 3
0
        public static MobileTabbedScreen Load(string Name)
        {
            MobileTabbedScreen retVal = null;
            string             item   = String.Format("{0}.{1}.{2}.xml", ConfigurationLoader.ConfigAssemblyName, "MobileScreens", Name);

            using (Stream fileStream = ConfigurationLoader.ConfigAssembly.GetManifestResourceStream(item))
            {
                using (XmlReader xreader = XmlReader.Create(fileStream))
                {
                    XDocument doc = XDocument.Load(xreader);

                    retVal = Load(doc);
                }
            }

            return(retVal);
        }