/// <summary> Constructor for a new instance of the <see cref="InstanceWide_UI_Configuration"/> class </summary>
 public InstanceWide_UI_Configuration()
 {
     CitationViewer = new CitationConfig();
     TemplateElements = new TemplateElementsConfig();
     WriterViewers = new WriterViewerConfig();
     MapEditor = new MapEditor_Configuration();
     StaticResources = new StaticResources_Configuration();
 }
        private static void read_item_writer_viewer_configs(XmlReader ReaderXml, WriterViewerConfig Config)
        {
            while (ReaderXml.Read())
            {
                if (ReaderXml.NodeType == XmlNodeType.Element)
                {
                    switch (ReaderXml.Name.ToLower())
                    {
                        case "menuprovider":
                            string menuassembly = null;
                            if (ReaderXml.MoveToAttribute("assembly"))
                                menuassembly = ReaderXml.Value.Trim();
                            if (ReaderXml.MoveToAttribute("class"))
                            {
                                string menuclass = ReaderXml.Value.Trim();
                                if ( !String.IsNullOrEmpty(menuclass))
                                    Config.Items.SetMainMenu(menuclass, menuassembly);
                            }
                            break;

                        case "itemviewer":
                            ItemSubViewerConfig newConfig = new ItemSubViewerConfig();
                            if (ReaderXml.MoveToAttribute("type"))
                                newConfig.ViewerType = ReaderXml.Value.Trim();
                            if (ReaderXml.MoveToAttribute("viewerCode"))
                                newConfig.ViewerCode = ReaderXml.Value.Trim();
                            if (ReaderXml.MoveToAttribute("assembly"))
                                newConfig.Assembly = ReaderXml.Value.Trim();
                            if (ReaderXml.MoveToAttribute("class"))
                                newConfig.Class = ReaderXml.Value.Trim();
                            if (ReaderXml.MoveToAttribute("enabled"))
                            {
                                bool tempValue;
                                if (bool.TryParse(ReaderXml.Value, out tempValue))
                                {
                                    newConfig.Enabled = tempValue;
                                }
                            }
                            if (ReaderXml.MoveToAttribute("mgmtViewer"))
                            {
                                bool tempValue;
                                if (bool.TryParse(ReaderXml.Value, out tempValue))
                                {
                                    newConfig.ManagementViewer = tempValue;
                                    if (ReaderXml.MoveToAttribute("mgmtOrder"))
                                    {
                                        float tempFloatValue;
                                        if (float.TryParse(ReaderXml.Value, out tempFloatValue))
                                            newConfig.ManagementOrder = tempFloatValue;
                                        else
                                            newConfig.ManagementOrder = 1000;
                                    }
                                    else
                                    {
                                        newConfig.ManagementOrder = 1000;
                                    }
                                }
                            }
                            if (ReaderXml.MoveToAttribute("pageFileExtensions"))
                            {
                                newConfig.PageExtensions = ReaderXml.Value.Trim().Split(new char[] { '|', ',' });
                            }
                            if (ReaderXml.MoveToAttribute("fileExtensions"))
                            {
                                newConfig.FileExtensions = ReaderXml.Value.Trim().Split(new char[] { '|', ',' });
                            }

                            // Check for minimum requirements
                            if ((!String.IsNullOrEmpty(newConfig.ViewerType)) && (!String.IsNullOrEmpty(newConfig.ViewerCode)))
                                Config.Items.Add_Viewer(newConfig);
                            break;
                    }
                }
            }
        }