Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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);
        }