本文整理汇总了C#中Android.App.ProgressDialog.Cancel方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog.Cancel方法的具体用法?C# ProgressDialog.Cancel怎么用?C# ProgressDialog.Cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.App.ProgressDialog
的用法示例。
在下文中一共展示了ProgressDialog.Cancel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnOptionsItemSelected
public IMenuItem OnOptionsItemSelected(IMenuItem item, EditDetailFragment fragment, View viewEditDetail, Presentation presentation)
{
Logging.Log (this, Logging.LoggingTypeDebug, "OnOptionsItemSelected()");
switch((ActionBarButtons)item.ItemId)
{
case ActionBarButtons.SelectPresentation:
fragment.Activity.RunOnUiThread(() => {
EditActivity editActivity = context as EditActivity;
if (editActivity != null)
editActivity.ShowPresentationSelection();
fragment.SetHasOptionsMenu(false);
});
break;
case ActionBarButtons.Save:
if (presentation != null)
{
SavePresentation(fragment, viewEditDetail, presentation);
Toast.MakeText(fragment.Activity, Resource.String.ToastPresentationSaved, ToastLength.Long).Show();
}
break;
case ActionBarButtons.Render:
// Async Daten Asyncron rendern lassen
ProgressDialog pdlg = new ProgressDialog(fragment.Activity);
pdlg.SetCancelable(false);
pdlg.SetTitle(fragment.GetText(Resource.String.ProgressRenderPresentation));
pdlg.SetMessage(fragment.GetText(Resource.String.PleaseWait));
pdlg.Show();
Task.Factory.StartNew(() => {
return new WSRenderGoogleIO2012(this.context).RenderPresentation(presentation.PresentationUID);
}).ContinueWith(t => {
pdlg.Cancel();
if (t.Exception == null && t.Result)
Toast.MakeText(fragment.Activity, Resource.String.ToastPresentationRendered, ToastLength.Long).Show();
else
{
fragment.Activity.RunOnUiThread(delegate() {
((BaseActivity)fragment.Activity).ShowErrorMsg(fragment.GetText(Resource.String.ToastErrorRenderPresentation));
});
}
}, TaskScheduler.FromCurrentSynchronizationContext());
break;
case ActionBarButtons.Present:
StartPresentation(fragment, presentation);
break;
}
return item;
}