private void addServerButton_Click(object sender, EventArgs e) { var statisticsServerAddDialog = new StatisticsServerAddDialog(); if (statisticsServerAddDialog.ShowDialog() != DialogResult.OK) return; try { _statisticsServers.Add(new StatisticsServer(statisticsServerAddDialog.WebUrl, statisticsServerAddDialog.DatabaseName, statisticsServerAddDialog.Username)); File.WriteAllText(Program.StatisticServersFilePath, Serializer.Serialize(_statisticsServers)); } catch (Exception ex) { Popup.ShowPopup(this, SystemIcons.Error, "Error while saving the server data.", ex, PopupButtons.Ok); return; } InitializeServers(); // Re-initialize the servers again }
private void addServerButton_Click(object sender, EventArgs e) { var statisticsServerAddDialog = new StatisticsServerAddDialog(); if (statisticsServerAddDialog.ShowDialog() != DialogResult.OK) { return; } try { _statisticsServers.Add(new StatisticsServer(statisticsServerAddDialog.WebUrl, statisticsServerAddDialog.DatabaseName, statisticsServerAddDialog.Username)); File.WriteAllText(Program.StatisticServersFilePath, Serializer.Serialize(_statisticsServers)); } catch (Exception ex) { Popup.ShowPopup(this, SystemIcons.Error, "Error while saving the server data.", ex, PopupButtons.Ok); return; } InitializeServers(); // Re-initialize the servers again }