Skip to content

Conversation

@hermitdave
Copy link
Contributor

Add DecodePixelHeight, DecodePixelType and DecodePixelWidth properties to ImageEx

Modify CacheBase GetItemAsync to pass list of KeyValuePair objects to pass to generic type instantiation

…s to ImageEx

Modify CacheBase GetItemAsync to pass list of KeyValuePair objects to pass to generic type instantiation
@hermitdave
Copy link
Contributor Author

Addresses issue #888

/// <param name="initializerKeyValues">key value pairs used when initializing instance of generic type</param>
/// <returns>awaitable task</returns>
protected override async Task<BitmapImage> InitializeTypeAsync(StorageFile baseFile)
protected override async Task<BitmapImage> InitializeTypeAsync(StorageFile baseFile, List<KeyValuePair<string, object>> initializerKeyValues)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be set to null by default to avoid breaking changes

/// <param name="initializerKeyValues">key value pairs used when initializing instance of generic type</param>
/// <returns>awaitable task</returns>
protected override async Task<BitmapImage> InitializeTypeAsync(IRandomAccessStream stream)
protected override async Task<BitmapImage> InitializeTypeAsync(IRandomAccessStream stream, List<KeyValuePair<string, object>> initializerKeyValues)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be set to null by default to avoid breaking changes

/// <param name="initializerKeyValues">key value pairs used when initializing instance of generic type</param>
/// <returns>awaitable task</returns>
protected abstract Task<T> InitializeTypeAsync(IRandomAccessStream stream);
protected abstract Task<T> InitializeTypeAsync(IRandomAccessStream stream, List<KeyValuePair<string, object>> initializerKeyValues);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be set to null by default to avoid breaking changes (true for all protected methods ;))

Copy link
Contributor

@deltakosh deltakosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few changes but overall LGTM

Copy link
Contributor

@shenchauhan shenchauhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of quick changes

var img = await ImageCache.Instance.GetFromCacheAsync(_uri, true, _tokenSource.Token);
var propValues = new List<KeyValuePair<string, object>>();

if (DecodePixelHeight != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<= 0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again sorry, should have said > 0

propValues.Add(new KeyValuePair<string, object>(nameof(DecodePixelHeight), DecodePixelHeight));
}

if (DecodePixelWidth != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<= 0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry should have said >0

@shenchauhan shenchauhan merged commit 2539d91 into dev Feb 13, 2017
@deltakosh deltakosh deleted the ImageEx-DecodeProperties branch February 16, 2017 18:47
@hermitdave hermitdave mentioned this pull request Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants