Example #1
0
        private void Init(TextReader projectXML)
        {
            ApplicationPropertiesCommon project  = new ApplicationPropertiesCommon();
            XmlReaderSettings           settings = new XmlReaderSettings();

            settings.IgnoreComments   = true;
            settings.IgnoreWhitespace = true;

            using (XmlReader reader = XmlReader.Create(projectXML))
            {
                try {
                    // Read nodes one at a time
                    while (reader.Read())
                    {
                        switch (reader.NodeType)
                        {
                        case XmlNodeType.Element:
                            if ("settings".Equals(reader.Name))
                            {
                                project.HandleConfiguration(reader);
                                projectXML.Close();
                                break;
                            }
                            else
                            {
                                project.Error(reader, "Tag " + reader.Name + " was unexpected");
                                break;
                            }

                        default:
                            project.Error(reader, "Unknown nodetype for: " + reader.Name);
                            projectXML.Close();
                            break;
                        }
                    }
                } catch (Exception ex) {
                    project.Error(reader, ex.ToString());
                    projectXML.Close();
                }
            }
            projectXML.Close();
        }
Example #2
0
        public static void Create(TextReader projectXML)
        {
            ApplicationPropertiesCommon properties = new ApplicationPropertiesCommon();

            properties.Init(projectXML);
        }