コード例 #1
0
 public static BitmapImage UserAvatarLoader(string actualLogin, IList <User> iList)
 {
     try
     {
         string      _url  = AvatarUrlFinder(actualLogin, iList);
         BitmapImage image = new BitmapImage(new Uri(_url));
         return(image);
     }
     catch
     {
         ReportMessage.Error("Unable to load user avatar");
         return(null);
     }
 }
コード例 #2
0
        //GIT HUB API LIMIT: ONLY 60 queries per hour
        private async void LoadActualUserRepositoryAsync(string userName)
        {
            try
            {
                var client = new GitHubClient(new ProductHeaderValue("my-cool-app"));

                IReadOnlyList <Repository> userRepositories = await client.Repository.GetAllForUser(userName);

                // LoadRepoComboBox(userRepositories);
                UserRepositoriesComboBox = ControlsValuesLoader.LoadRepositoryComboBox(UserRepositoriesComboBox, userRepositories);

                var user = await client.User.Get(userName);

                string repos = user.PublicRepos.ToString();
                RepositoriesCountLabel.Content = repos;
            }
            catch
            {
                ReportMessage.Error("Unable to load github data");
            }
        }