Example #1
0
        // Serializes the data when the Save Button is clicked.
        private void saveButton_Click(object sender, EventArgs e)
        {
            configMgr.ColorScheme     = colorSchemeBox.Text.ToString().ToLower();
            configMgr.Saturation      = saturationBox.Text.ToString();
            configMgr.Gain            = gainBox.Text.ToString();
            configMgr.WindowFunction  = windowFunctionBox.Text.ToString().ToLower();
            configMgr.ChannelMode     = channelModeBox.Text.ToString().ToLower();
            configMgr.Scale           = scaleBox.Text.ToString();
            configMgr.ClearImages     = clearImagesBox.Checked;
            configMgr.ShowLegend      = showFrequencyBox.Checked;
            configMgr.EnableDebugging = debugModeBox.Checked;

            configMgr.Save(configPath());


            if (enableSeekbarBox.Checked)
            {
                if (!File.Exists(seekbarPath()))
                {
                    File.Create(seekbarPath());
                }
            }
            else if (!enableSeekbarBox.Checked)
            {
                if (File.Exists(seekbarPath()))
                {
                    File.Delete(seekbarPath());
                }
            }



            if (disableHeaderBox.Checked)
            {
                if (!File.Exists(headerPath()))
                {
                    File.Create(headerPath());
                }
            }
            else if (!disableHeaderBox.Checked)
            {
                if (File.Exists(headerPath()))
                {
                    File.Delete(headerPath());
                }
            }

            MessageBox.Show("Settings Saved.");
        }
Example #2
0
        private void saveSettings()
        {
            if (CheckForDuplicates())
            {
                MessageBox.Show("Please remove duplicate values before saving.");
            }
            else
            {
                configMgr.ILCP          = ILbox.SelectedItem.ToString();
                configMgr.ILThresholdCP = ILTbox.SelectedItem.ToString();
                configMgr.LRACP         = DRbox.SelectedItem.ToString();
                configMgr.LRThresholdCP = LRTbox.SelectedItem.ToString();
                configMgr.LRALowCP      = LRALbox.SelectedItem.ToString();
                configMgr.LRAHighCP     = LRAHbox.SelectedItem.ToString();
                configMgr.PeakCP        = Pbox.SelectedItem.ToString();
                configMgr.AverageCP     = ALbox.SelectedItem.ToString();
                configMgr.CurrentCP     = CLbox.SelectedItem.ToString();

                configMgr.Save(configPath());
            }
        }