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


C# UIAlertView.Dispose方法代码示例

本文整理汇总了C#中UIAlertView.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# UIAlertView.Dispose方法的具体用法?C# UIAlertView.Dispose怎么用?C# UIAlertView.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIAlertView的用法示例。


在下文中一共展示了UIAlertView.Dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Complete

		/// <summary>
		/// Event when complete is pressed
		/// </summary>
		partial void Complete ()
		{
			//Check if they signed
			if (assignmentViewModel.Signature == null) {
				new UIAlertView(string.Empty, "Signature is required.", null, "Ok").Show ();
				return;
			}

			alertView = new UIAlertView("Complete?", "Are you sure?", null, "Yes", "No");
			alertView.Dismissed += (sender, e) => {
				alertView.Dispose ();
				alertView = null;

				if (e.ButtonIndex == 0) {
					completeButton.Enabled = false;
					assignment.Status = AssignmentStatus.Complete;
					assignmentViewModel
						.SaveAssignmentAsync (assignment)
						.ContinueWith (_ => {
							BeginInvokeOnMainThread (() => {
								tableView.ReloadData ();
								
								var detailsController = controller.ParentViewController as AssignmentDetailsController;
								detailsController.UpdateAssignment ();

								var menuController = detailsController.ParentViewController.ChildViewControllers[1] as MenuController;
								menuController.UpdateAssignment ();
							});
						});
				}
			};
			alertView.Show();
		}
开发者ID:EminosoftCorp,项目名称:prebuilt-apps,代码行数:36,代码来源:CompleteCell.cs

示例2: SignIn

		async Task<bool> SignIn()
		{
			var tcs = new TaskCompletionSource<bool> ();
			var alert = new UIAlertView ("Please sign in", "", null, "Cancel", "Ok");
			alert.AlertViewStyle = UIAlertViewStyle.SecureTextInput;
			var tb = alert.GetTextField(0);
			tb.ShouldReturn = (t)=>{

				alert.DismissWithClickedButtonIndex(1,true);
				signIn(tcs,tb.Text);
				return true;
			};

			alert.Clicked += async (object sender, UIButtonEventArgs e) => {
				if(e.ButtonIndex == 0)
				{
					tcs.TrySetResult(false);
					alert.Dispose();
					return;
				}

				var id = tb.Text;
				signIn(tcs,id);
			
			
			};
			alert.Show ();
			return await tcs.Task;
		}
开发者ID:nagyist,项目名称:iPadPos,代码行数:29,代码来源:PaymentViewController.cs

示例3: HandleAddButtonClicked

 public override void HandleAddButtonClicked(object sender, EventArgs e)
 {
     #if LITE
     if(Contacts.GetAll().Count >= Settings.MaxGroupFreeVersion)
     {
         UIAlertView alert = new UIAlertView(Settings.GetLocalizedString("SMS Party Free", LocalizedKey),
                                             Settings.GetLocalizedString("SMS Party Free only allows a maximum of 5 groups to be created", LocalizedKey),
                                             null, "OK");
         alert.Show();
         alert.Dispose();
         return;
     }
     #endif
     CreateButtonTapped();
 }
开发者ID:zekiller3,项目名称:SMSParty,代码行数:15,代码来源:MainScreenGroup.cs

示例4: Decline

		/// <summary>
		/// Event when the decline button is clicked
		/// </summary>
		partial void Decline ()
		{
			alertView = new UIAlertView("Decline Assignment", "Are you sure?", null, "Yes", "No");
			alertView.Dismissed += (sender, e) => {
				if (e.ButtonIndex == 0) {
					assignment.Status = AssignmentStatus.Declined;

					SaveAssignment ();
				}

				alertView.Dispose ();
				alertView = null;
			};
			alertView.Show ();
		}
开发者ID:felipecembranelli,项目名称:MyXamarinSamples,代码行数:18,代码来源:AssignmentCell.cs

示例5: ShowAlert

 public static void ShowAlert(string title, string message, Action dismissed = null)
 {
     var alert = new UIAlertView {Title = title, Message = message};
     alert.DismissWithClickedButtonIndex(alert.AddButton("Ok"), true);
     if (dismissed != null)
         alert.Dismissed += (sender, e) =>
         {
             dismissed();    
             alert.Dispose();
         };
     alert.Show();
 }
开发者ID:Mikoj,项目名称:CodeBucket,代码行数:12,代码来源:Util.cs

示例6: DeletePhoto

		/// <summary>
		/// Event when the delete photo buttton is pressed
		/// </summary>
		partial void DeletePhoto ()
		{
			alertView = new UIAlertView ("Delete?", "Are you sure?", null, "Yes", "No");
			alertView.Dismissed += (sender, e) => {

				if (e.ButtonIndex == 0) {
					photoViewModel
						.DeletePhotoAsync (assignmentViewModel.SelectedAssignment, photoViewModel.SelectedPhoto)
						.ContinueWith (_ => {
							BeginInvokeOnMainThread (() => DismissViewController (true, null));
						});
				}

				alertView.Dispose ();
				alertView = null;
			};
			alertView.Show ();
		}
开发者ID:lotofcaffeine,项目名称:field-service-example,代码行数:21,代码来源:AddPhotoController.cs


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