当前位置: 首页>>代码示例>>C#>>正文


C# TaskCompletionSource.AttachCompletionHandler方法代码示例

本文整理汇总了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;
		}
开发者ID:thomashandda,项目名称:Microsoft-Band-SDK-Bindings,代码行数:13,代码来源:BandSensorManagerExtensions.cs

示例2: RemovePagesTaskAsync

		public static Task RemovePagesTaskAsync (this IBandTileManager manager, NSUuid tileId)
		{
			var tcs = new TaskCompletionSource<object> ();
			manager.RemovePagesAsync (tileId, tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandTileManagerExtensions.cs

示例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;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandTileManagerExtensions.cs

示例4: GetRemainingTileCapacityTaskAsync

        public static Task<nuint> GetRemainingTileCapacityTaskAsync (this IBandTileManager manager)
		{
			var tcs = new TaskCompletionSource<nuint> ();
            manager.GetRemainingTileCapacityAsync (tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandTileManagerExtensions.cs

示例5: RemoveTileTaskAsync

		public static Task RemoveTileTaskAsync (this IBandTileManager manager, BandTile tile)
		{
			var tcs = new TaskCompletionSource<object> ();
			manager.RemoveTileAsync (tile, tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandTileManagerExtensions.cs

示例6: GetTilesTaskAsync

		public static Task<BandTile[]> GetTilesTaskAsync (this IBandTileManager manager)
		{
			var tcs = new TaskCompletionSource<BandTile[]> ();
			manager.GetTilesAsync (tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandTileManagerExtensions.cs

示例7: GetFirmwareVersionTaskAsync

		public static Task<string> GetFirmwareVersionTaskAsync (this BandClient client)
		{
			var tcs = new TaskCompletionSource<string> ();
			client.GetFirmwareVersionAsync (tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandClientExtensions.cs

示例8: VibrateTaskAsync

		public static Task VibrateTaskAsync (this IBandNotificationManager manager, VibrationType vibrationType)
		{
			var tcs = new TaskCompletionSource<object> ();
			manager.VibrateAsync (vibrationType, tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandNotificationManagerExtensions.cs

示例9: UnregisterNotificationTaskAsync

		public static Task UnregisterNotificationTaskAsync (this IBandNotificationManager manager)
		{
			var tcs = new TaskCompletionSource<object> ();
			manager.UnregisterNotificationAsync (tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandNotificationManagerExtensions.cs

示例10: RegisterNotificationTaskAsync

		public static Task RegisterNotificationTaskAsync (this IBandNotificationManager manager, NSUuid tileID)
		{
			var tcs = new TaskCompletionSource<object> ();
			manager.RegisterNotificationAsync (tileID, tcs.AttachCompletionHandler ());
			return tcs.Task;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandNotificationManagerExtensions.cs

示例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;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandNotificationManagerExtensions.cs

示例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;
		}
开发者ID:JamesEarle,项目名称:Microsoft-Band-SDK-Bindings,代码行数:6,代码来源:BandNotificationManagerExtensions.cs

示例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


注:本文中的TaskCompletionSource.AttachCompletionHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。