private void ConfigureClipSize(object sender, RoutedEventArgs e) { var dialog = new TextDialog("Enter Ammount of ammo that a clip can contain", "Configure Clip Size", Settings.Default.ClipSize); dialog.ShowDialog(); if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { VariableStorage.ViewModel.ClipSize = dialog.GetEnteredText(); Settings.Default.ClipSize = dialog.GetEnteredText(); Settings.Default.Save(); } }
public static bool setupSocketConnection() { var dialog = new TextDialog("Enter IP Address", "Enter IP", Settings.Default.IPAddress); dialog.ShowDialog(); if (dialog.DialogResult.Value && dialog.DialogResult.Value) { string hostName = dialog.GetEnteredText(); IPAddress IP; IPAddress.TryParse(hostName, out IP); VariableStorage._socketHelper = new SocketHelper(IP); VariableStorage.ipaddress = Settings.Default.IPAddress; VariableStorage._socketHelper.SendToServer("client:pc:connected"); return(true); } else { MessageBox.Show("Closing Program"); BattleBotClientWPF.MainWindow.CloseAppS(false); } return(false); }