BUG-2016: Added SVG support for the jira plugin, need to decide if it's worth the extra KB's...

This commit is contained in:
Robin 2016-09-02 10:48:01 +02:00
commit 745a56291c
10 changed files with 248 additions and 34 deletions

View file

@ -31,7 +31,7 @@ namespace GreenshotJiraPlugin
/// <summary>
/// This is the bach for the IssueType bitmaps
/// </summary>
public class IssueTypeBitmapCache : AsyncMemoryCache<Issue, Bitmap>
public class IssueTypeBitmapCache : AsyncMemoryCache<IssueType, Bitmap>
{
private readonly JiraApi _jiraApi;
@ -42,9 +42,14 @@ namespace GreenshotJiraPlugin
ExpireTimeSpan = TimeSpan.FromHours(1);
}
protected override async Task<Bitmap> CreateAsync(Issue issue, CancellationToken cancellationToken = new CancellationToken())
protected override string CreateKey(IssueType keyObject)
{
return await _jiraApi.GetUriContentAsync<Bitmap>(issue.Fields.IssueType.IconUri, cancellationToken).ConfigureAwait(false);
return keyObject.Name;
}
protected override async Task<Bitmap> CreateAsync(IssueType issueType, CancellationToken cancellationToken = new CancellationToken())
{
return await _jiraApi.GetUriContentAsync<Bitmap>(issueType.IconUri, cancellationToken).ConfigureAwait(false);
}
}
}