Here are the examples of the csharp api System.Threading.Tasks.Task.FromResult(short) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
19
Source : RemoteGattServer.android.cs
with MIT License
from inthehand
with MIT License
from inthehand
Task<short> PlatformReadRssi()
{
TaskCompletionSource<short> tcs = new TaskCompletionSource<short>();
void handler(object s, RssiEventArgs e)
{
ReadRemoteRssi -= handler;
switch (e.Status)
{
case ABluetooth.GattStatus.Success:
tcs.SetResult(e.Rssi);
break;
default:
tcs.SetResult(0);
break;
}
}
ReadRemoteRssi += handler;
bool success = _gatt.ReadRemoteRssi();
if (success)
{
return tcs.Task;
}
else
{
return Task.FromResult((short)0);
}
}
19
Source : RemoteGattServer.standard.cs
with MIT License
from inthehand
with MIT License
from inthehand
Task<short> PlatformReadRssi()
{
return Task.FromResult((short)0);
}
19
Source : ProxyGeneratorAsyncCallsTest.cs
with Apache License 2.0
from JetBrains
with Apache License 2.0
from JetBrains
public Task<short> sSum(short a, short b) => Task.FromResult(unchecked((short)(a + b)));