本文整理汇总了C#中TaskCompletionSource.AttachCompletionHandler方法的典型用法代码示例。如果您正苦于以下问题:C# TaskCompletionSource.AttachCompletionHandler方法的具体用法?C# TaskCompletionSource.AttachCompletionHandler怎么用?C# TaskCompletionSource.AttachCompletionHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskCompletionSource
的用法示例。
在下文中一共展示了TaskCompletionSource.AttachCompletionHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RequestHeartRateUserConsentTaskAsync
public static Task<bool> RequestHeartRateUserConsentTaskAsync(this IBandSensorManager sensorManager)
{
var tcs = new TaskCompletionSource<bool> ();
if (sensorManager.HeartRateUserConsent == UserConsent.Granted)
{
tcs.SetResult(true);
}
else
{
sensorManager.RequestHeartRateUserConsentAsync (tcs.AttachCompletionHandler ());
}
return tcs.Task;
}
示例2: RemovePagesTaskAsync
public static Task RemovePagesTaskAsync (this IBandTileManager manager, NSUuid tileId)
{
var tcs = new TaskCompletionSource<object> ();
manager.RemovePagesAsync (tileId, tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例3: SetPagesTaskAsync
public static Task SetPagesTaskAsync (this IBandTileManager manager, PageData[] pageData, NSUuid tileId)
{
var tcs = new TaskCompletionSource<object> ();
manager.SetPagesAsync (pageData, tileId, tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例4: GetRemainingTileCapacityTaskAsync
public static Task<nuint> GetRemainingTileCapacityTaskAsync (this IBandTileManager manager)
{
var tcs = new TaskCompletionSource<nuint> ();
manager.GetRemainingTileCapacityAsync (tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例5: RemoveTileTaskAsync
public static Task RemoveTileTaskAsync (this IBandTileManager manager, BandTile tile)
{
var tcs = new TaskCompletionSource<object> ();
manager.RemoveTileAsync (tile, tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例6: GetTilesTaskAsync
public static Task<BandTile[]> GetTilesTaskAsync (this IBandTileManager manager)
{
var tcs = new TaskCompletionSource<BandTile[]> ();
manager.GetTilesAsync (tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例7: GetFirmwareVersionTaskAsync
public static Task<string> GetFirmwareVersionTaskAsync (this BandClient client)
{
var tcs = new TaskCompletionSource<string> ();
client.GetFirmwareVersionAsync (tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例8: VibrateTaskAsync
public static Task VibrateTaskAsync (this IBandNotificationManager manager, VibrationType vibrationType)
{
var tcs = new TaskCompletionSource<object> ();
manager.VibrateAsync (vibrationType, tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例9: UnregisterNotificationTaskAsync
public static Task UnregisterNotificationTaskAsync (this IBandNotificationManager manager)
{
var tcs = new TaskCompletionSource<object> ();
manager.UnregisterNotificationAsync (tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例10: RegisterNotificationTaskAsync
public static Task RegisterNotificationTaskAsync (this IBandNotificationManager manager, NSUuid tileID)
{
var tcs = new TaskCompletionSource<object> ();
manager.RegisterNotificationAsync (tileID, tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例11: SendMessageTaskAsync
public static Task SendMessageTaskAsync (this IBandNotificationManager manager, NSUuid tileID, string title, string body, NSDate timeStamp, MessageFlags flags)
{
var tcs = new TaskCompletionSource<object> ();
manager.SendMessageAsync (tileID, title, body, timeStamp, flags, tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例12: ShowDialogTaskAsync
public static Task ShowDialogTaskAsync (this IBandNotificationManager manager, NSUuid tileID, string title, string body)
{
var tcs = new TaskCompletionSource<object> ();
manager.ShowDialogAsync (tileID, title, body, tcs.AttachCompletionHandler ());
return tcs.Task;
}
示例13: GetThemeTaskAsync
public static Task<BandTheme> GetThemeTaskAsync (this IBandPersonalizationManager manager)
{
var tcs = new TaskCompletionSource<BandTheme> ();
manager.GetThemeAsync (tcs.AttachCompletionHandler ());
return tcs.Task;
}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandPersonalizationManagerExtensions.cs
示例14: SetThemeTaskAsync
public static Task SetThemeTaskAsync (this IBandPersonalizationManager manager, BandTheme theme)
{
var tcs = new TaskCompletionSource<object> ();
manager.SetThemeAsync (theme, tcs.AttachCompletionHandler ());
return tcs.Task;
}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandPersonalizationManagerExtensions.cs
示例15: SetMeTileImageTaskAsync
public static Task SetMeTileImageTaskAsync (this IBandPersonalizationManager manager, BandImage image)
{
var tcs = new TaskCompletionSource<object> ();
manager.SetMeTileImageAsync (image, tcs.AttachCompletionHandler ());
return tcs.Task;
}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandPersonalizationManagerExtensions.cs