This project is read-only.
1
Vote

Make library WinRT compatible

description

The library currently isn't WinRT compatible, meaning you can't use this in a background task.
The fix is actually pretty simple. There's only 7 compile errors to fix this. The gist of it is changing methods returning Task<T> to IAsyncOperation<T>, and change List<T> to IList<T>.

Example:
public static async Task<List<DeviceInformation>> GetDevicesOfService(string serviceUuid)
Change to:
public static Windows.Foundation.IAsyncOperation<IList<DeviceInformation>> GetDevicesOfServiceAsync(string serviceUuid)
{
    return GetDevicesOfService(serviceUuid).AsAsyncOperation();
}
internal static async Task<IList<DeviceInformation>> GetDevicesOfService(string serviceUuid)
{
     //rest of the original code goes here
Also: Note I change the method to be postfixed 'Async' to follow the .NET naming guidelines.

comments

SharpGIS wrote Dec 10, 2014 at 9:27 PM

...Actually I might have overstated the impact. It's a little more work than that (base sensor class can't be abstract, must have internal constructor and subclasses must be sealed).