Exemple #1
0
        private void LoadApplicationOptions()
        {
            string appConfigFilename = Application.ExecutablePath + ".xml";

            if (File.Exists(appConfigFilename))
            {
                try
                {
                    string s = File.ReadAllText(Application.ExecutablePath + ".xml");
                    Hwd.Serialization.Decoder decoder = new Hwd.Serialization.Decoder();
                    AppOptions = (ApplicationOptions)decoder.Decode(s);
                }
                catch (Hwd.Serialization.SerializationException exc)
                {
                    _logView.LogExcStr(exc, "Failed deserializing application options");
                }
            }
            else
            {
                AppOptions = new ApplicationOptions();
            }

            if (AppOptions == null)
            {
                AppOptions = new ApplicationOptions();
            }

            // Apply UI settings to project browser.
            ProjectBrowser.TreeView.Columns[0].Width = AppOptions.ProjectCol0Width;
            ProjectBrowser.TreeView.Columns[1].Width = AppOptions.ProjectCol1Width;
            ProjectBrowser.TreeView.Columns[2].Width = AppOptions.ProjectCol2Width;
            ProjectBrowser.TreeView.Columns[3].Width = AppOptions.ProjectCol3Width;

            // Set the plugin options.
            PluginManager.SetAllOptions(
                AppOptions.PluginOptions,
                AppOptions.PluginParserOptions);
        }
        private void LoadApplicationOptions()
        {
            string appConfigFilename = Application.ExecutablePath + ".xml";
            if (File.Exists(appConfigFilename))
            {
                try
                {
                    string s = File.ReadAllText(Application.ExecutablePath + ".xml");
                    Hwd.Serialization.Decoder decoder = new Hwd.Serialization.Decoder();
                    AppOptions = (ApplicationOptions)decoder.Decode(s);
                }
                catch (Hwd.Serialization.SerializationException exc)
                {
                    _logView.LogExcStr(exc, "Failed deserializing application options");
                }
            }
            else
            {
                AppOptions = new ApplicationOptions();
            }

            if (AppOptions == null)
            {
                AppOptions = new ApplicationOptions();
            }

            // Apply UI settings to project browser.
            ProjectBrowser.TreeView.Columns[0].Width = AppOptions.ProjectCol0Width;
            ProjectBrowser.TreeView.Columns[1].Width = AppOptions.ProjectCol1Width;
            ProjectBrowser.TreeView.Columns[2].Width = AppOptions.ProjectCol2Width;
            ProjectBrowser.TreeView.Columns[3].Width = AppOptions.ProjectCol3Width;

            // Set the plugin options.
            PluginManager.SetAllOptions(
                AppOptions.PluginOptions,
                AppOptions.PluginParserOptions);
        }