public async Task TestGetProjectsAsync() { var projects = await _jiraApi.GetProjectsAsync(); Assert.NotNull(projects); Assert.NotNull(projects.Count > 0); foreach (var project in projects) { var avatar = await _jiraApi.GetAvatarAsync <Bitmap>(project.Avatar, AvatarSizes.Medium); Assert.True(avatar.Width == 24); var projectDetails = await _jiraApi.GetProjectAsync(project.Key); Assert.NotNull(projectDetails); } }
private async void MainWindow_Loaded(object sender, RoutedEventArgs e) { var jiraApi = new JiraApi(new Uri("https://greenshot.atlassian.net")); var projects = await jiraApi.GetProjectsAsync(); foreach (var project in projects) { // Demonstrate the Avatar and it's underlying GetAsAsync<BitmapSource> // could also be done with setting the source of the image, but this might not work without login var avatar = await jiraApi.GetAvatarAsync<BitmapSource>(project.Avatar); Projects.Add(new Project { Title = project.Name, Avatar = avatar }); } }
private async void MainWindow_Loaded(object sender, RoutedEventArgs e) { var jiraApi = new JiraApi(new Uri("https://greenshot.atlassian.net")); var projects = await jiraApi.GetProjectsAsync(); foreach (var project in projects) { // Demonstrate the Avatar and it's underlying GetAsAsync<BitmapSource> // could also be done with setting the source of the image, but this might not work without login var avatar = await jiraApi.GetAvatarAsync <BitmapSource>(project.Avatar); Projects.Add(new Project { Title = project.Name, Avatar = avatar }); } }
/// <summary> /// Retrieve the avatar for the current size. /// </summary> /// <param name="key">AvatarUrls</param> /// <param name="cancellationToken">CancellationToken</param> /// <returns>BitmapSource</returns> protected override async Task <BitmapSource> CreateAsync(AvatarUrls key, CancellationToken cancellationToken = new CancellationToken()) { return(await _jiraApi.GetAvatarAsync <BitmapSource>(key, AvatarSize, cancellationToken)); }