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


C# UIAlertView类代码示例

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


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

示例1: SyncWebBrowserError

 public void SyncWebBrowserError(Exception ex)
 {
     InvokeOnMainThread(() => {
         UIAlertView alertView = new UIAlertView("Sync Web Browser Error", ex.Message, null, "OK", null);
         alertView.Show();
     });
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:7,代码来源:SyncWebBrowserViewController.cs

示例2: HandleTodaysMenuCompleted

		void HandleTodaysMenuCompleted (object sender, TodaysMenuCompletedEventArgs args)
		{
			InvokeOnMainThread (delegate	{
				if (Util.IsAsynchCompletedError (args, "TodaysMenu")) {
					//Util.PopNetworkActive ();
					_hud.StopAnimating ();
					//_hud.Hide (true);
					this.NavigationItem.RightBarButtonItem.Enabled = true;
					return;
				}
				try {
					DishesOfTheDay result = args.Result;
					this.tblTageskarte.Source = new TableSource (result.DishOfTheDay.ToList ());
					this.tblTageskarte.ReloadData ();
				} catch (Exception ex) {
					using (UIAlertView alert = new UIAlertView("TodaysMenuCompleted",ex.Message,null,"OK",null)) {
						alert.Show ();
					}
				} finally {
					//Util.PopNetworkActive ();
					this.NavigationItem.RightBarButtonItem.Enabled = true;
					
					_hud.StopAnimating ();
					//_hud.Hide (true);
					//_hud.RemoveFromSuperview ();
					//_hud = null;
				}
			});
		}
开发者ID:bpug,项目名称:LbkIos,代码行数:29,代码来源:TageskarteViewController.cs

示例3: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			TableView.SeparatorColor = UIColor.Clear;

			if (UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Pad) {
				NSNotificationCenter defaultCenter = NSNotificationCenter.DefaultCenter;
				defaultCenter.AddObserver (UIKeyboard.WillHideNotification, OnKeyboardNotification);
				defaultCenter.AddObserver (UIKeyboard.WillShowNotification, OnKeyboardNotification);
			}

            if (String.IsNullOrEmpty(tokenPayment.Token))
            {

				DispatchQueue.MainQueue.DispatchAfter (DispatchTime.Now, () => {						

					UIAlertView _error = new UIAlertView ("Missing Token", "No Card Token found. Please provide application with token via Pre-Authentication or Payment", null, "ok", null);
					_error.Show ();

					_error.Clicked += (sender, args) => {
						PaymentButton.Disable();
						if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
							this.DismissViewController (true, null);
						} else {
							this.NavigationController.PopToRootViewController (true);
						}
					};

				});
			} else {

				SetUpTableView ();

				UITapGestureRecognizer tapRecognizer = new UITapGestureRecognizer ();

				tapRecognizer.AddTarget (() => { 
					if (KeyboardVisible) {
						DismissKeyboardAction ();
					}
				});

				tapRecognizer.NumberOfTapsRequired = 1;
				tapRecognizer.NumberOfTouchesRequired = 1;

				EncapsulatingView.AddGestureRecognizer (tapRecognizer);
				PaymentButton.Disable();

				PaymentButton.SetTitleColor (UIColor.Black, UIControlState.Application);

				PaymentButton.TouchUpInside += (sender, ev) => {
					MakeTokenPayment ();
				};

				if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
					FormClose.TouchUpInside += (sender, ev) => {
						this.DismissViewController (true, null);
					};
				}
			}
		}
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:60,代码来源:TokenPreAuthorisationView.cs

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

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

示例6: SendMessage

 public void SendMessage(string message, string title = null)
 {
     Helpers.EnsureInvokedOnMainThread (() => {
         var alertView = new UIAlertView (title ?? string.Empty, message, null, "OK");
         alertView.Show ();
     });
 }
开发者ID:rferolino,项目名称:MeetupManager,代码行数:7,代码来源:MessageDialog.cs

示例7: Show

		internal static void Show(string p, string p_2)
		{
			UIAlertView uiav = new UIAlertView("Status", p_2, null, "OK");
			uiav.Show();

			return;
		}
开发者ID:holisticware-admin,项目名称:HolisticWare.PR.DevUG.CKVZ.SlideShow,代码行数:7,代码来源:MessageBox.cs

示例8: WillMoveToSuperview

		public override void WillMoveToSuperview (UIView newsuper)
		{
			
			base.WillMoveToSuperview (newsuper);
			SetUpToggle (AVSSwitch, JudoSDKManager.AVSEnabled, () => {
				JudoSDKManager.AVSEnabled = !JudoSDKManager.AVSEnabled;
			});
			SetUpToggle (ThreeDSwitch, JudoSDKManager.ThreeDSecureEnabled, () => {
				JudoSDKManager.ThreeDSecureEnabled = !JudoSDKManager.ThreeDSecureEnabled;
			});
			SetUpToggle (RiskSwitch, JudoSDKManager.RiskSignals, () => {
				JudoSDKManager.RiskSignals = !JudoSDKManager.RiskSignals;
			});
			SetUpToggle (MaestroSwitch, JudoSDKManager.MaestroAccepted, () => {
				JudoSDKManager.MaestroAccepted = !JudoSDKManager.MaestroAccepted;
			});
			SetUpToggle (AmexSwitch, JudoSDKManager.AmExAccepted, () => {
				JudoSDKManager.AmExAccepted = !JudoSDKManager.AmExAccepted;
			});
			SetUpToggle (NoneUISwitch, !JudoSDKManager.UIMode, () => {
				JudoSDKManager.UIMode = !JudoSDKManager.UIMode;
				if (JudoSDKManager.UIMode)
					return;

				UIAlertView nonUIWarning = new UIAlertView ("Non-UI Mode",
					                              "You are about to use non UI Mode so please look at the source code to understand the usage of Non-UI APIs.",
					                              null, "OK", null);
				nonUIWarning.Show ();
			});
				
			AttachTouchEvents ();
			ArrowIcon.Transform = CGAffineTransform.MakeRotation ((nfloat)(180.0f * Math.PI) / 180.0f);

		}
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:34,代码来源:SlideUpMenu.cs

示例9: btnCalc_TouchUpInside

partial         void btnCalc_TouchUpInside(UIButton sender)
        {
            UIAlertView _error = new UIAlertView("Error", "Please fill in all fields with positive values", null, "OK", null);

            try
            {

            double interest = double.Parse (txtRate.Text);
            int principal = int.Parse (txtPrincipal.Text);
            int monthly = int.Parse (txtMonthly.Text);
            double rate = interest / 1200;

                double payments = (Math.Log(monthly) - Math.Log(monthly - (principal * rate))) / (Math.Log(1 + rate));
                decimal numberOfPayments = Convert.ToDecimal(payments);
                numberOfPayments = Math.Ceiling(numberOfPayments);

                UIAlertView good = new UIAlertView("Number of monthly payments (rounded up):", numberOfPayments.ToString(), null, "OK", null);

            good.Show();

            }

            catch (Exception)
            {

                _error.Show();

            }
            //double monthly = rate > 0 ? ((rate + rate / (Math.Pow (1 + rate, months) - 1)) * principal) : principal / months;
        }
开发者ID:ISK-E,项目名称:Debtstroyer,代码行数:30,代码来源:PaymentsController.cs

示例10: SendEmail

		public void SendEmail ()
		{
			UIView activeView = _viewController.TableView.FindFirstResponder ();
			if (activeView != null) {
				activeView.ResignFirstResponder ();
			}
			_context.Fetch ();
			/*
			var test2 = _viewController.TableView.FindRecursive<UITextField> (t => t.Placeholder.Contains ("Email")).FirstOrDefault ();
			if (test2.CanBecomeFirstResponder) {
				test2.BecomeFirstResponder ();
			}
			*/
			
			if (Validate ()) {
				//TODO: Send via WebService
				Util.PushNetworkActive ();
				NSTimer.CreateScheduledTimer (2, delegate {
					Util.PopNetworkActive ();
					var alert = new UIAlertView ("", Locale.GetText ("Vielen Dank für Ihre Nachricht."), null, "OK", null);
					alert.Show ();
					alert.Clicked += delegate {
						_navigation.PopToRootViewController (true);
					};
				});
			}
		}
开发者ID:bpug,项目名称:LbkIos,代码行数:27,代码来源:DirektKontakController.cs

示例11: ShowPopup

		void ShowPopup(FavoriteViewModel vm)
		{
			if (null == vm)
				return;

			var popup = new UIAlertView(View.Frame);

			popup.Title = vm.Name;

			popup.AddButton("Fjern fra favoritter");
			popup.AddButton("Vis detaljer");
			popup.AddButton("Avbryt");

			popup.CancelButtonIndex = 2;

			popup.Dismissed += (sender, e) =>
			{
				switch(e.ButtonIndex)
				{
					case 0 : 
						ViewModel.RemoveFavorite(vm.DocumentNumber, vm);
						break;

					case 1: 
						ViewModel.ShowDetailsCommand.Execute(vm);
						break;
				}
			};

			popup.Show();
		}
开发者ID:khellang,项目名称:Solvberget,代码行数:31,代码来源:MyPageFavoritesView.cs

示例12: ShowPopup

		void ShowPopup(LoanViewModel vm)
		{
			if (null == vm)
				return;

			var popup = new UIAlertView(View.Frame);

			popup.Title = vm.DocumentTitle;

			popup.AddButton("Utvid lånetid");
			popup.AddButton("Vis detaljer");
			popup.AddButton("Avbryt");

			popup.CancelButtonIndex = 2;

			popup.Dismissed += (sender, e) =>
			{
				switch(e.ButtonIndex)
				{
					case 0 : 
						ViewModel.ExpandLoan(vm.DocumentNumber);
						break;

					case 1: 
						ViewModel.ShowDetailsCommand.Execute(vm);
						break;
				}
			};

			popup.Show();
		}
开发者ID:khellang,项目名称:Solvberget,代码行数:31,代码来源:MyPageLoansView.cs

示例13: Alert

 private void Alert(string caption, string msg)
 {
     using (UIAlertView av = new UIAlertView(caption, msg, null, "OK", null))
     {
         av.Show();
     }
 }
开发者ID:aaronhe42,项目名称:MonoTouch-Examples,代码行数:7,代码来源:BrowserViewController.cs

示例14: Display

		public void Display (string body, string title, GoalsAvailable goalAvailable, string cancelButtonTitle, string acceptButtonTitle = "", Action<GoalsAvailable, int> action = null)
		{
			UIAlertView alert = new UIAlertView();
			alert.Title = title;
			alert.AddButton(acceptButtonTitle);
			alert.AddButton(cancelButtonTitle);
			alert.Message = body;
			alert.AlertViewStyle = UIAlertViewStyle.PlainTextInput;
			alert.GetTextField(0).KeyboardType=UIKeyboardType.NumberPad;
			const int maxCharacters =7;
			alert.GetTextField(0).ShouldChangeCharacters = (textField, range, replacement) =>
			{
				var newContent = new NSString(textField.Text).Replace(range, new NSString(replacement)).ToString();
				int number;
				return newContent.Length <= maxCharacters && (replacement.Length == 0 || int.TryParse(replacement, out number));
			};
			alert.Clicked += (object s, UIButtonEventArgs ev) =>
			{
				if(action != null)
				{
					if(ev.ButtonIndex ==0)
					{
						string input = alert.GetTextField(0).Text;
						int goalValue;
						int.TryParse(input, out goalValue);
						action.Invoke(goalAvailable, goalValue);
					}
				}
			};
			alert.Show();
		}
开发者ID:MobileFit,项目名称:CoachV2,代码行数:31,代码来源:InputGoalDialog.cs

示例15: ViewDidLoad

 public override void ViewDidLoad ()
 {
     base.ViewDidLoad ();
     
     tv.BecomeFirstResponder ();
     
     toolbar.Items[0].Clicked += (o, s) =>
     {
         string text = tv.Text;
         NSData pdfData = CreatePDF (text, 500f, 700f);
         
         if (MFMailComposeViewController.CanSendMail) {
             _mail = new MFMailComposeViewController ();
             _mail.SetMessageBody (tv.Text, false);
             _mail.AddAttachmentData (pdfData, "text/x-pdf", "test.pdf");
             _mail.Finished += HandleMailFinished;
             this.PresentModalViewController (_mail, true);
         } else {
             UIAlertView alert = new UIAlertView ("App", "Could not send mail.", null, "OK", null);
             alert.Show ();
         }
     };
     
     toolbar.Items[1].Clicked += (o, s) =>
     {
         _pdf = new PDFViewController (tv.Text);
         this.PresentModalViewController (_pdf, true);
     };
 }
开发者ID:enricos,项目名称:learning_monotouch_code,代码行数:29,代码来源:SendPDFController.xib.cs


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