コード例 #1
0
 protected void TestConnection()
 {
     var validator = new YouTrackConnectionValidator();
     var errorMessage = "";
     if (!validator.TryValidateConnection(new ReTrackSettings
     {
         Username = Username,
         Password = Password,
         Url = Url
     }, out errorMessage))
     {
         MessageBox.Show(
             errorMessage,
             "Test Connection", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else
     {
         MessageBox.Show(
             string.Format("Successfully connected to {0}.", Url),
             "Test Connection", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
コード例 #2
0
 private void TestConnection_Click(object sender, RoutedEventArgs e)
 {
     var validator = new YouTrackConnectionValidator();
       var errorMessage = "";
       if (!validator.TryValidateConnection(new ReTrackSettings
       {
     Username = UsernameBox.Text,
     Password = PasswordBox.Text,
     Url = UrlBox.Text
       }, out errorMessage))
       {
     MessageBox.Show(
     errorMessage,
     "Test Connection", MessageBoxButton.OK, MessageBoxImage.Error);
       }
       else
       {
     MessageBox.Show(
     string.Format("Successfully connected to {0}.", UrlBox.Text),
     "Test Connection", MessageBoxButton.OK, MessageBoxImage.Information);
       }
 }