wpf_player.PeerSettingsDialog.okButton_Click C# (CSharp) Method

okButton_Click() private method

Ok button click handler. This method check if the form data are valid : if they are the result is true and the dialog will be closed else an alert box will be showed
private okButton_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        private void okButton_Click(object sender, RoutedEventArgs e)
        {
            if (!IsValid(this))
            {
                MessageBox.Show(this, "Some port number are not valid", "Peer Configuration Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            else
            {
                this.DialogResult = true;
                this.Close();
            }
        }