本文整理汇总了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();
}
示例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;
}
示例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();
}
示例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 ();
}
示例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();
}
示例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 ();
}