Example #1
0
 private void AddDestinationButton_Click(object sender, EventArgs e)
 {
     var loader = new PanelLoader();
     loader.RemoveDestination += this.loader_RemoveDestination;
     this.panelLoaders.Add(loader);
     var tabPage = new TabPage(string.Format("Submit #{0}", this.panelLoaders.Count));
     tabPage.Controls.Add(loader);
     this.mainTabs.TabPages.Add(tabPage);
 }
Example #2
0
        /// <summary>
        /// Loads the settings file or loads defaults is settings file is empty or invalid.
        /// </summary>
        /// <param name="createNew">Force creating of new file. Overrides existing file by default.</param>
        private void LoadSettingsFile(bool createNew)
        {
            this.settingsFile.Position = 0;
            SettingsOverride.LoadCustomSettings(this.settingsFile);
            this.InitializeControls();

            this.fileTextBox.Text = createNew == false ? this.openFileDialog.FileName : this.createFileDialog.FileName;

            // Read application settings
            this.uiProviderComboBox.SelectedItem = Settings.UIProvider;
            this.uiModeComboBox.SelectedItem = Settings.UIMode; // Should come after uiProviderComboBox = ...
            this.miniDumpTypeComboBox.SelectedItem = Settings.MiniDumpType;
            this.sleepBeforeSendNumericUpDown.Value = Settings.SleepBeforeSend;
            this.maxQueuedReportsNumericUpDown.Value = Settings.MaxQueuedReports;
            this.stopReportingAfterNumericUpDown.Value = Settings.StopReportingAfter;
            this.writeLogToDiskCheckBox.Checked = Settings.WriteLogToDisk;
            this.exitApplicationImmediatelyCheckBox.Checked = Settings.ExitApplicationImmediately;
            this.handleProcessCorruptedStateExceptionsCheckBox.Checked = Settings.HandleProcessCorruptedStateExceptions;
            this.releaseModeCheckBox.Checked = Settings.ReleaseMode;

            if (Settings.StoragePath == StoragePath.Custom)
            {
                this.storagePathComboBox.SelectedItem = StoragePath.Custom;
                this.customStoragePathTextBox.Text = Settings.StoragePath;
            }
            else
            {
                // Make sure that we're getting the enum value
                this.storagePathComboBox.SelectedItem = (StoragePath)Settings.StoragePath;
            }

            if (Settings.Cipher != null && Settings.Cipher.Length != 0)
            {
                this.encryptConnectionStringsCheckBox.Checked = true;
            }

            if (this.settingsFile.Name.EndsWith("app.config"))
            {
                this.writeNetworkTraceToFileCheckBox.Enabled = true;
                this.networkTraceWarningLabel.Enabled = true;

                if (Settings.EnableNetworkTrace.HasValue)
                {
                    this.writeNetworkTraceToFileCheckBox.Checked = Settings.EnableNetworkTrace.Value;
                }
            }

            while (this.mainTabs.TabPages.Count > 2)
            {
                this.mainTabs.TabPages.RemoveAt(2);
            }

            this.panelLoaders.Clear();

            // Read connection strings
            foreach (var destination in Settings.Destinations)
            {
                var loader = new PanelLoader();
                loader.RemoveDestination += this.loader_RemoveDestination;
                loader.LoadPanel(destination.ConnectionString);
                this.panelLoaders.Add(loader);
                var tabPage = new TabPage(string.Format("Submit #{0}", this.panelLoaders.Count));
                tabPage.Controls.Add(loader);
                this.mainTabs.TabPages.Add(tabPage);
            }
        }