Beispiel #1
0
        private void DoLogin()
        {
            AddToOutput("Logging in...." + Environment.NewLine, false, GetTimeStamp(), _OUTPUT_COLOR);
            try
            {
                if (!string.IsNullOrWhiteSpace(txtConsumerKey.Text) && !string.IsNullOrWhiteSpace(txtConsumerSecret.Text) && !string.IsNullOrWhiteSpace(txtUsername.Text))
                {
                    _SharpBucket.OAuth2ClientCredentials(txtConsumerKey.Text, txtConsumerSecret.Text);

                    var userEndPoint = _SharpBucket.UsersEndPoint(Properties.Settings.Default.username);
                    _UserProfile    = userEndPoint.GetProfile();
                    tsUserName.Text = _UserProfile.display_name + $" ({_UserProfile.username}) ";

                    mainTabs.SelectedIndex = 1;

                    AddToOutput("Login success." + Environment.NewLine, false, GetTimeStamp(), _OUTPUT_SUCCESS_COLOR);
                }
                else
                {
                    AddToOutput("Invalid login info." + Environment.NewLine, false, GetTimeStamp(), _OUTPUT_ERROR_COLOR);
                }
            }
            catch (Exception ex)
            {
                AddToOutput("Error during login : "******" - " + ex.Message + Environment.NewLine, false, GetTimeStamp(), _OUTPUT_ERROR_COLOR);
            }
        }
Beispiel #2
0
 private static void TestUsersEndPoint(SharpBucketV2 sharpBucket)
 {
     var usersEndPoint = sharpBucket.UsersEndPoint(accountName);
     var profile       = usersEndPoint.GetProfile();
     var followers     = usersEndPoint.ListFollowers();
     var following     = usersEndPoint.ListFollowing();
     var repositories  = usersEndPoint.ListRepositories();
 }
 public void Init()
 {
     sharpBucket   = TestHelpers.SharpBucketV2;
     usersEndPoint = sharpBucket.UsersEndPoint(SampleRepositories.MERCURIAL_ACCOUNT_UUID);
 }
Beispiel #4
0
 public void Init()
 {
     sharpBucket   = TestHelpers.SharpBucketV2;
     usersEndPoint = sharpBucket.UsersEndPoint(ACCOUNT_NAME);
 }
 public void Init()
 {
     sharpBucket   = TestHelpers.GetV2ClientAuthenticatedWithOAuth();
     usersEndPoint = sharpBucket.UsersEndPoint(ACCOUNT_NAME);
 }