public static void InitializeFields(this AddEditServerHltv addEditServerWindow) { addEditServerWindow.Dispatcher.Invoke(new Action(() => { InitializeGeneralFields(addEditServerWindow); })); }
public static void AddHltvServer(this MainWindow mainWindow) { IServer server = new ValveHltvServer(); AddEditServerHltv editWindow = new AddEditServerHltv(mainWindow, server); editWindow.Title = Properties.Resources.aes_AddNewServerTitle; if (editWindow.ShowDialog() == true) { mainWindow._serversControl.Servers.Add(server); SaveOptions(mainWindow, mainWindow._configFileName); } }
public static void OpenProperties(this MainWindow mainWindow) { if (mainWindow.dataGridServersList.SelectedCells.Count > 0) { if (mainWindow.dataGridServersList.SelectedIndex >= 0) { IServer server = (mainWindow.dataGridServersList.SelectedItem as IServer); switch (server.Options.Type) { case ServerType.GoldSource: { AddEditServerGoldSource editWindow = new AddEditServerGoldSource(mainWindow, server); editWindow.Title = string.Format(Properties.Resources.aes_EditServerTitle, server.Options.HostName); if (editWindow.ShowDialog() == true) { SaveOptions(mainWindow, mainWindow._configFileName); } break; } case ServerType.Source: { AddEditServerSource editWindow = new AddEditServerSource(mainWindow, server); editWindow.Title = string.Format(Properties.Resources.aes_EditServerTitle, server.Options.HostName); if (editWindow.ShowDialog() == true) { SaveOptions(mainWindow, mainWindow._configFileName); } break; } case ServerType.Hltv: { AddEditServerHltv editWindow = new AddEditServerHltv(mainWindow, server); editWindow.Title = string.Format(Properties.Resources.aes_EditServerTitle, server.Options.HostName); if (editWindow.ShowDialog() == true) { SaveOptions(mainWindow, mainWindow._configFileName); } break; } } mainWindow.dataGridServersList.Items.Refresh(); } } }
public static void Save(this AddEditServerHltv addEditServerWindow) { SaveGeneral(addEditServerWindow); addEditServerWindow.serverOptions.CloneObjectProps(addEditServerWindow.server.Options); }