Example #1
0
        private void SaveApplicationOptions()
        {
            // Update the options from the UI.
            AppOptions.ProjectFilename  = ProjectBrowser.ProjectFilename;
            AppOptions.ProjectCol0Width = ProjectBrowser.TreeView.Columns[0].Width;
            AppOptions.ProjectCol1Width = ProjectBrowser.TreeView.Columns[1].Width;
            AppOptions.ProjectCol2Width = ProjectBrowser.TreeView.Columns[2].Width;
            AppOptions.ProjectCol3Width = ProjectBrowser.TreeView.Columns[3].Width;

            // Update the options from the plugins.
            PluginManager.GetAllOptions(
                AppOptions.PluginOptions,
                AppOptions.PluginParserOptions);


            string appConfigFilename = Application.ExecutablePath + ".xml";

            try
            {
                Hwd.Serialization.Encoder encoder = new Hwd.Serialization.Encoder();
                string s = encoder.Encode(AppOptions);
                File.WriteAllText(appConfigFilename, s);
            }
            catch (Hwd.Serialization.SerializationException exc)
            {
                _logView.LogExcStr(exc, "Failed serializing application options");
            }
        }
Example #2
0
        private void SaveApplicationOptions()
        {
            // Update the options from the UI.
            AppOptions.ProjectFilename = ProjectBrowser.ProjectFilename;
            AppOptions.ProjectCol0Width = ProjectBrowser.TreeView.Columns[0].Width;
            AppOptions.ProjectCol1Width = ProjectBrowser.TreeView.Columns[1].Width;
            AppOptions.ProjectCol2Width = ProjectBrowser.TreeView.Columns[2].Width;
            AppOptions.ProjectCol3Width = ProjectBrowser.TreeView.Columns[3].Width;

            // Update the options from the plugins.
            PluginManager.GetAllOptions(
                AppOptions.PluginOptions,
                AppOptions.PluginParserOptions);

            string appConfigFilename = Application.ExecutablePath + ".xml";
            try
            {
                Hwd.Serialization.Encoder encoder = new Hwd.Serialization.Encoder();
                string s = encoder.Encode(AppOptions);
                File.WriteAllText(appConfigFilename, s);
            }
            catch (Hwd.Serialization.SerializationException exc)
            {
                _logView.LogExcStr(exc, "Failed serializing application options");
            }
        }