1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
namespace SourceBrowser.Site.Models
{
    using Newtonsoft.Json.Linq;
    using System;
    using System.Collections.Generic;
    using SolutionRetriever;

    [Serializable]
    public class GithubUserStructure
    {
        public string Username;
        public string Path;
        public IList<GithubRepoStructure> Repos;

        public string FullName;
        public string AvatarURL;
        public string GitHubURL;
        public string BlogURL;

        public void UseLiveData()
        {
            try
            {
                GitHubInformationRetriever.GetUserInformation(Username, ref FullName, ref AvatarURL, ref GitHubURL, ref BlogURL);
            }
            catch
            {
                // Swallow. This information is not essential to operation of SourceBrowser.
            }
        }

        public override string ToString()
        {
            return String.Format("User {0} with {1} repo{2}", Username, Repos.Count, Repos.Count == 1 ? "" : "s");
        }
    }
}