public LoginPage(PullRequestTab tab)
        {
            this.Tab       = tab;
            this.ViewModel = new LoginPageVM(tab);

            this.InitializeComponent();
        }
Ejemplo n.º 2
0
        public PullRequestPageVM(PullRequestTab tab, AzureDevOpsUserContext userContext)
        {
            this.devopsUserContext = userContext;
            this.Tab            = tab;
            this.accounts       = new ObservableCollection <AccountVM>(userContext.Accounts.OrderBy(a => a.AccountName).Select(a => new AccountVM(a)));
            this.projects       = new ObservableCollection <ProjectReferenceVM>();
            this.pullRequests   = new ObservableCollection <PullRequestVM>();
            this.currentAccount = new AccountVM(null);
            this.currentProject = new ProjectReferenceVM(null);

            this.avatars        = new Dictionary <Uri, ImageSource>();
            this.pendingAvatars = new Dictionary <Uri, List <IAvatarSite> >();

            // Cookie container is used so we can get caching on avatar images
            CookieContainer   cookies = new CookieContainer();
            HttpClientHandler handler = new HttpClientHandler
            {
                CookieContainer = cookies
            };

            this.avatarHttpClient = new HttpClient(handler);
            this.avatarHttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", userContext.AuthenticationResult.AccessToken);
            this.avatarHttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("image/png"));
        }
Ejemplo n.º 3
0
 public LoginPageVM(PullRequestTab tab)
 {
     this.tab         = tab;
     this.displayText = Resources.LoginPage_InitialText;
     this.infoText    = string.Empty;
 }