Esempio n. 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            //Se establece un borde para el textarea de las observaciones
            this.cmpDescripcion.Layer.BorderWidth = 1.0f;
            this.cmpDescripcion.Layer.BorderColor = UIColor.Gray.CGColor;
            this.cmpDescripcion.Layer.ShadowColor = UIColor.Black.CGColor;
            this.cmpDescripcion.Layer.CornerRadius = 8;

            this.btnGuardar.TouchUpInside += (sender, e) => {
                UIAlertView alert = new UIAlertView(){
                    Title = "Aviso" , Message = "¿Escorrecta la informacion?"
                };
                alert.AddButton ("SI");
                alert.AddButton ("NO");
                alert.Clicked += (s, o) => {
                    if(o.ButtonIndex==0){
                        try{
                            newDetailService = new NewDetailService();
                            String respuesta = newDetailService.SetData(TaskDetailView.tareaId, this.cmpDescripcion.Text, MainView.user);
                            if(respuesta.Equals("1")){
                                SuccesConfirmation();
                            }else if(respuesta.Equals("0")){
                                ErrorConfirmation();
                            }
                        }catch(System.Net.WebException){
                            ServerError();
                        }
                    }
                };
                alert.Show();
            };
        }
partial         void DisplayButtonPress(NSObject sender)
        {
            DisplayLabel.Text = "Hello World";
            //			UIAlertView alert = new UIAlertView ("Title", "Display AlertView", null , "OK", "Cancel");
            //			alert.Show();

            //			UIAlertView alert = new UIAlertView ("Alert Title", "Choose from two buttons", null, "OK", new string[] {"Cancel"});
            //			alert.Clicked += (s, b) => {
            //				DisplayLabel.Text = "Button " + b.ButtonIndex.ToString () + " clicked";
            //				Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked");
            //			};
            //			alert.Show();

            UIAlertView alert = new UIAlertView () {
                Title = "custom buttons alert",
                Message = "this alert has custom buttons"
            };
            alert.AddButton("OK");
            alert.AddButton("custom button 1");
            alert.AddButton("Cancel");

            alert.Clicked += delegate(object a, UIButtonEventArgs b) {
                DisplayLabel.Text = "Button " + b.ButtonIndex.ToString () + " clicked";
                Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked"); };
            alert.Show ();
        }
Esempio n. 3
0
        private static Task<string> PlatformShow(string title, string description, string defaultText, bool usePasswordMode)
        {
            tcs = new TaskCompletionSource<string>();

            UIApplication.SharedApplication.InvokeOnMainThread(delegate
            {
                alert = new UIAlertView();
                alert.Title = title;
                alert.Message = description;
                alert.AlertViewStyle = usePasswordMode ? UIAlertViewStyle.SecureTextInput : UIAlertViewStyle.PlainTextInput;
                alert.AddButton("Cancel");
                alert.AddButton("Ok");
                UITextField alertTextField = alert.GetTextField(0);
                alertTextField.KeyboardType = UIKeyboardType.ASCIICapable;
                alertTextField.AutocorrectionType = UITextAutocorrectionType.No;
                alertTextField.AutocapitalizationType = UITextAutocapitalizationType.Sentences;
                alertTextField.Text = defaultText;
                alert.Dismissed += (sender, e) =>
                {
                    if (!tcs.Task.IsCompleted)
                        tcs.SetResult(e.ButtonIndex == 0 ? null : alert.GetTextField(0).Text);
                };

                // UIAlertView's textfield does not show keyboard in iOS8
                // http://stackoverflow.com/questions/25563108/uialertviews-textfield-does-not-show-keyboard-in-ios8
                if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
                    alert.Presented += (sender, args) => alertTextField.SelectAll(alert);

                alert.Show();
            });

            return tcs.Task;
        }
Esempio n. 4
0
		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();
		}
Esempio n. 5
0
		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();
		}
		void ShowPopup(ReservationViewModel vm)
		{
			if (null == vm)
				return;

			var popup = new UIAlertView(View.Frame);

			popup.Title = vm.DocumentTitle;

			popup.AddButton("Kanseller reservasjon");
			popup.AddButton("Vis detaljer");
			popup.AddButton("Avbryt");

			popup.CancelButtonIndex = 2;

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

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

			popup.Show();
		}
Esempio n. 7
0
		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();
		}
Esempio n. 8
0
        public void Show(string text, string firstOption, string secondOption, Action firstAction, Action secondAction)
        {
            Mvx.Resolve<IMvxMainThreadDispatcher>().RequestMainThreadAction(() =>
            {
                if (_alertView != null)
                {
                    _alertView.DismissWithClickedButtonIndex(0, true);
                }

                _alertView = new UIAlertView();
                _alertView.AddButton(firstOption);
                _alertView.AddButton(secondOption);
                _alertView.Message = text ?? string.Empty;

                _alertView.Clicked += (sender, arg) =>
                {
                    if (arg.ButtonIndex == 0)
                    {
                        firstAction();
                    }
                    else if (arg.ButtonIndex == 1)
                    {
                        secondAction();
                    }
                };
                _alertView.Show();
            });
        }
		public static void AskYesNo (string title, string message)
		{
			UIAlertView alert = new UIAlertView ();
			alert.Title = title;
			alert.AddButton ("Yes");
			alert.AddButton ("No");
			alert.Message = message;
			alert.Delegate = new MyAlertViewDelegate ();
			alert.Show ();
		}
Esempio n. 10
0
 public Task<bool> PromptYesNo(string title, string message)
 {
     var tcs = new TaskCompletionSource<bool>();
     var alert = new UIAlertView {Title = title, Message = message};
     alert.CancelButtonIndex = alert.AddButton("No");
     var ok = alert.AddButton("Yes");
     alert.Clicked += (sender, e) => tcs.SetResult(e.ButtonIndex == ok);
     alert.Show();
     return tcs.Task;
 }
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            var aleart = new UIAlertView() { Title = "Warning", Message = "Jail break iphone with btstack is required.\nShould start inquiry?" };
            aleart.AddButton("Cancel");
            aleart.AddButton("OK");
            aleart.Dismissed += new EventHandler<UIButtonEventArgs>(aleart_Dismissed);
            aleart.Show();
        }
Esempio n. 12
0
		internal  Task<int> FnTwoButtonedAlertDialog(string strTitle,string strMessage,string strNegativeButton,string strPositiveButton)
		{
			var taskCompletionSource = new TaskCompletionSource<int> ();
			alertView =alertView ?? new UIAlertView ();
			alertView.Title = strTitle;
			alertView.Message = strMessage;
			alertView.AddButton ( strNegativeButton);
			alertView.AddButton (strPositiveButton );

			alertView.Clicked += ( (sender , e ) => taskCompletionSource.TrySetResult ( Convert.ToInt32 ( e.ButtonIndex.ToString () ) ) );
			alertView.Show ();

			Console.WriteLine ( taskCompletionSource.Task.ToString() );
			return taskCompletionSource.Task;
 
		}
Esempio n. 13
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            BootStrap ();

             		MessageHub.Subscribe<PeopleMessage>((m) =>{

                Dispatch(()=>{

                    var message = "People message received @ " + DateTime.Now;
                    message += ": " + m.Content
                        .Select(p=> p.Surname)
                            .Aggregate((text, item) =>
                                text + " Surname: " + item);

                    UIAlertView alert = new UIAlertView();
                    alert.Title = "Service Call returned";
                    alert.AddButton("Ok");
                    alert.Message = message;
                    alert.Show();
                });
            });

            Repo.GetPeople();

            window.MakeKeyAndVisible ();
            return true;
        }
 private void Login(object sender, EventArgs e)
 {
     if (ValidateFields ()) {
         User user = new User ();
         user.UserName = txtLogin.Text;
         user.Password = txtPassword.Text;
         if (controller.ExistUser (user)) {
             WelcomeController w = new WelcomeController ();
             this.NavigationController.PushViewController (w, true);
         } else {
             //No existe el usario con dicha contraseña en la db
             UIAlertView alert = new UIAlertView () {
                 Title = "Error", Message = "Error en el usuario o la clave"
             };
             alert.AddButton ("OK");
             alert.Show ();
         }
     } else {
         //No ha ingresado todos los campos
         UIAlertView alert = new UIAlertView () {
             Title = "Error", Message = "Por favor ingrese sus datos"
         };
         alert.AddButton ("OK");
         alert.Show ();
     }
 }
        public override void Clicked(UIActionSheet actionview, int buttonIndex)
        {
            if (buttonIndex == 0)
            {
                Console.Write("Satya!!!!!!");

                /*UIActivityIndicatorView spinner = new UIActivityIndicatorView(new RectangleF(0,0,200,300));
                spinner.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
                spinner.Center= new PointF(160, 140);
                spinner.HidesWhenStopped = true;
                actionview.AddSubview(spinner);
                InvokeOnMainThread(delegate() {
                    spinner.StartAnimating();
                });

                */

                var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);

                fileName = documents + "/" + fileName;

                data = NSData.FromUrl(_nsurl);
                File.WriteAllBytes(fileName,data.ToArray());

                if (File.Exists(fileName))
                {
                    UIAlertView alert = new UIAlertView();
                    alert.Title = "Download Complete";
                    alert.AddButton("Done");
                    alert.Show();
                }
                    //spinner.StopAnimating();

            }
        }
Esempio n. 16
0
		async void HandleTouchUpInside()
		{
			//No Network Message
			if (!CrossConnectivity.Current.IsConnected) {
				UIAlertView alert = new UIAlertView () { 
					Title = "No Network", Message = "Please Connect to Internet"
				};
				alert.AddButton ("OK");
				alert.Show ();
			} else {
				if (txtEmail.Text.Length > 0 && txtPassword.Text.Length > 0) {

//					if(await APIUtility.IsVPNConnectionStatus()){
						LoginAPIcall();
//					}
//					else{
//						UIAlertView alert = new UIAlertView () { 
//							Title = "Try Again", Message = "Check your VPN connection"
//						};
//						alert.AddButton ("OK");
//						alert.Show ();
//					}
				} else {
					UIAlertView alert = new UIAlertView () { 
						Title = "Failed..!!", Message = "Please Enter username and password"
					};
					alert.AddButton ("OK");
					alert.Show ();
				}

			}
		}
 private void ShowErrorAlert()
 {
     var alertView = new UIAlertView();
     alertView.Title = "Oops!";
     alertView.Message = "Could not connect to AgileZen. Check network connection, or API key";
     alertView.AddButton("OK");
     alertView.Show();
 }
Esempio n. 18
0
 public void ErrorConfirmation()
 {
     UIAlertView alert = new UIAlertView(){
         Title = "Error", Message = "La tarea no pudo ser finalizada, intentelo de nuevo"
     };
     alert.AddButton("Aceptar");
     alert.Show();
 }
Esempio n. 19
0
		internal static void FnShowAlertDialog(string strTitlt,string strMessage,string strOkButtonText)
		{ 
			var alertView = new UIAlertView ();
			alertView.Title = strTitlt;
			alertView.Message = strMessage;
			alertView.AddButton ( strOkButtonText );
			alertView.Show ();
		} 
Esempio n. 20
0
 public void SuccesConfirmation()
 {
     UIAlertView alert = new UIAlertView(){
         Title = "Correcto", Message = "Tarea Finalizada Correctamente"
     };
     alert.AddButton("Aceptar");
     alert.Show();
 }
Esempio n. 21
0
 public void ErrorConfirmation()
 {
     UIAlertView alert = new UIAlertView(){
         Title = "Error", Message = "El detalle no pudo guardarse, intentelo de nuevo"
     };
     alert.AddButton("Aceptar");
     alert.Show();
 }
		void HandleButtonHelloTouchUpInside (object sender, EventArgs e)
		{
			UIAlertView view = new UIAlertView();
			view.Title = "Say Hello!";
			view.Message = "Hello, World!";
			view.AddButton("OK");
			view.Show();
		}
Esempio n. 23
0
 public void ServerError()
 {
     UIAlertView alert = new UIAlertView(){
         Title = "Error", Message = "Error de conexión, no se pudo conectar con el servidor, intentelo de nuevo"
     };
     alert.AddButton("Aceptar");
     alert.Show();
 }
Esempio n. 24
0
		public void PresentAlert()
		{
			UIAlertView alert = new UIAlertView () { 
				Title = "alert title", Message = "this is a simple alert"
			};
			alert.AddButton("OK");
			alert.Show ();
		}
Esempio n. 25
0
 public static void Alert(string title, string message)
 {
     UIAlertView alert = new UIAlertView();
     alert.Title = title;
     alert.Message = message;
     alert.AddButton("OK");
     alert.Show();
 }
Esempio n. 26
0
        public FieldImage(string farmName,int farmID,FlyoutNavigationController fnc,SelectField sf)
            : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement (null) {};
            this.Pushing = true;

            var section = new Section () {};
            var totalRainGuage = new StringElement ("Total Raid Guage(mm): " + DBConnection.getRain (farmID),()=>{});
            var rainGuage=new EntryElement ("New Rain Guage(mm): ",null,"         ");
            rainGuage.KeyboardType = UIKeyboardType.NumbersAndPunctuation;
            var update=new StringElement("Add",()=>{
                try{
                DBConnection.updateRain(farmID,Int32.Parse(rainGuage.Value));
                }
                catch(Exception e){
                    new UIAlertView ("Error", "Wrong input format!", null, "Continue").Show ();
                    return;
                }
                UIAlertView alert = new UIAlertView ();
                alert.Title = "Success";
                alert.Message = "Your Data Has Been Saved";
                alert.AddButton("OK");
                alert.Show();
            });
            var showDetail=new StringElement("Show Rain Guage Detail",()=>{
                RainDetail rd=new RainDetail(farmID,farmName);
                sf.NavigationController.PushViewController(rd,true);
            });
            section.Add (totalRainGuage);
            section.Add (rainGuage);
            section.Add (update);
            section.Add (showDetail);

            Root.Add (section);

            var section2 = new Section () { };
            var farmImg=UIImage.FromFile ("img/"+farmName+".jpg");
            if(farmImg==null)
                farmImg=UIImage.FromFile ("Icon.png");
            var imageView = new UIImageView (farmImg);
            if(farmImg==null)
                farmImg=UIImage.FromFile ("Icon.png");

            var scrollView=new UIScrollView (
                new RectangleF(0,0,fnc.View.Frame.Width-20,250)
            );

            scrollView.ContentSize = imageView.Image.Size;
            scrollView.AddSubview (imageView);

            scrollView.MaximumZoomScale = 3f;
            scrollView.MinimumZoomScale = .1f;
            scrollView.ViewForZoomingInScrollView += (UIScrollView sv) => { return imageView; };

            var imageElement=new UIViewElement(null,scrollView,false);
            section2.Add(imageElement);
            Root.Add (section2);
        }
Esempio n. 27
0
		public void CSw_ValueChange(object sender,EventArgs e)
		{
			UIAlertView alert = new UIAlertView ();
			alert.Title="Message";
			alert.Message = ((((UISwitch)sender).Selected == true) ? "true" : "false");
			Console.WriteLine (sender);
			alert.AddButton ("OK");
			alert.Show ();
		}
Esempio n. 28
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            _controller = new MainController();
            window.RootViewController = _controller;

            _notificationAlert = new UIAlertView();
            _notificationAlert.Title = "App receive local notification";
            _notificationAlert.AddButton("Yes");
            _notificationAlert.AddButton("No");
            _notificationAlert.CancelButtonIndex = 1;
            _notificationAlert.Clicked += OnButtonPressed;

            window.MakeKeyAndVisible();

            return true;
        }
Esempio n. 29
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            tableView.DeselectRow (indexPath, true); // normal iOS behaviour is to remove the blue highlight

            var alert = new UIAlertView();
            alert.Message = string.Format("{0} tapped!", tableItems[indexPath.Row]);
            alert.AddButton("OK");
            alert.Show();
        }
Esempio n. 30
0
		public void Display (string body, string title, BarriersAvailable barrierAvailable, string cancelButtonTitle, string acceptButtonTitle = "", Action<BarriersAvailable, string> action = null)
		{
			UIAlertView alert = new UIAlertView();
			alert.Title = title;
			alert.AddButton(acceptButtonTitle);
			alert.AddButton(cancelButtonTitle);
			alert.Message = body;
			alert.AlertViewStyle = UIAlertViewStyle.PlainTextInput;
			var textField = alert.GetTextField (0);
			CGRect frameRect = textField.Frame;
			CGSize size = new CGSize (150, 60);
			frameRect.Size = size;
			textField.Frame = frameRect;


			alert.Clicked += (object s, UIButtonEventArgs ev) =>
			{
				if(action != null)
				{
					if(ev.ButtonIndex ==0)
					{
						string input = alert.GetTextField(0).Text;
						action.Invoke(barrierAvailable, input);
					}
				}
			};
			alert.Show();


//			UIAlertController alert = UIAlertController.Create (title, body, UIAlertControllerStyle.Alert);
//
//			alert.AddAction (UIAlertAction.Create (acceptButtonTitle, UIAlertActionStyle.Default, action2 => {
//				//SendComment(alert.TextFields[0].Text);
//				string input = alert.TextFields[0].Text;
//				action.Invoke(barrierAvailable, input);
//			}));
//
//			alert.AddAction (UIAlertAction.Create (cancelButtonTitle, UIAlertActionStyle.Cancel, null));
//			alert.AddTextField ((field) => {
//				field.Placeholder = title;
//			});
//
//			alert.
		}
Esempio n. 31
0
        public static Nullable <int> ShowMessageBox(string title,
                                                    string text,
                                                    IEnumerable <string> buttons,
                                                    int focusButton,
                                                    MessageBoxIcon icon)
        {
            Nullable <int> result = null;

            if (!isMessageBoxShowing)
            {
                isMessageBoxShowing = true;

                UIAlertView alert = new UIAlertView();
                alert.Title = title;
                foreach (string btn in buttons)
                {
                    alert.AddButton(btn);
                }
                alert.Message    = text;
                alert.Dismissed += delegate(object sender, UIButtonEventArgs e)
                {
                    result = e.ButtonIndex;
                    isMessageBoxShowing = false;
                };
                alert.Clicked += delegate(object sender, UIButtonEventArgs e)
                {
                    result = e.ButtonIndex;
                    isMessageBoxShowing = false;
                };

                GetInvokeOnMainThredObj().InvokeOnMainThread(delegate {
                    alert.Show();
                });
            }

            isVisible = isMessageBoxShowing;

            return(result);
        }
Esempio n. 32
0
        public void ShowPopup(CustomYesNoBox popup)
        {
            var alert = new UIAlertView
            {
                Title   = popup.Title,
                Message = popup.Text
            };

            foreach (var b in popup.Buttons)
            {
                alert.AddButton(b);
            }

            alert.Clicked += (s, args) =>
            {
                popup.OnPopupClosed(new CustomYesNoBoxClosedArgs
                {
                    Button = popup.Buttons.ElementAt(Convert.ToInt32(args.ButtonIndex)),
                });
            };
            alert.Show();
        }
Esempio n. 33
0
        public void NuevoGasto()
        {
            if (txtMonto.Text == "" || txtDescripcion.Text == "")
            {
                UIAlertView alert = new UIAlertView()
                {
                    Title   = "Error!",
                    Message = "Ingresa datos por favor!"
                };
                alert.AddButton("OK");
                alert.Show();
            }
            else
            {
                var outcome = new Gasto
                {
                    Monto       = int.Parse(txtMonto.Text),
                    Descripcion = txtDescripcion.Text,
                    Fecha       = DateTime.Now
                };

                object[] keys   = { "Monto", "Descripcion", "Fecha" };
                object[] values = { outcome.Monto, outcome.Descripcion, outcome.Fecha };

                DatabaseReference Gasto = referenceBD.GetChild("Gastos");
                var data = NSDictionary.FromObjectsAndKeys(values, keys, keys.Length);

                Gasto.SetValue(data);
                txtMonto.Text       = "";
                txtDescripcion.Text = "";
                UIAlertView alert = new UIAlertView()
                {
                    Title   = "Exito!",
                    Message = "Ingreso registrado exitosamente!"
                };
                alert.AddButton("OK");
                alert.Show();
            }
        }
        //If row is selected, go to Patient Information page
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            //Store patient selected to display his information on next page
            if (Session.selectedPatient == null)
            {
                //step.Text = "Please, select a patient";
                UIAlertView alert = new UIAlertView()
                {
                    Message = "Please select patient"
                };
                alert.AddButton("OK");
                alert.Show();
            }
            else
            {
                RuleEngine re = new RuleEngine();
                Session.selectedArea.name = tableItems[indexPath.Row];
                string a = re.determineAntibiotic(tableItems[indexPath.Row]);

                if (a != null)
                {
                    Session.antibioticInformation = Controller.getAntibiotic(a);
                    UIViewController home = parent.Storyboard.InstantiateViewController("AntibioticList") as AntibioticList;
                    parent.NavigationController.PushViewController(home, true);
                }
                else
                {
                    UIAlertView alert = new UIAlertView()
                    {
                        Title   = "Alert",
                        Message = "Missing information"
                    };
                    alert.AddButton("OK");
                    alert.Show();
                }

                tableView.DeselectRow(indexPath, true);
            }
        }
Esempio n. 35
0
        private void Results(Data route)
        {
            //Used for debuging. Shows the users locations and the number of data points
            int counter = 0;

            foreach (CLLocationCoordinate2D l in route.locs)
            {
                counter++;
                if (debugPrint)
                {
                    Console.WriteLine(counter + " " + l.Latitude + " " + l.Longitude);
                }
            }
            UIAlertView alerting = new UIAlertView()
            {
                Title   = "Data Points Collected",
                Message = counter + " points of reference" + Environment.NewLine + Environment.NewLine + "Shots Found: " + sound.High_Level_Detected
            };

            alerting.AddButton("Okay");
            alerting.Show();
        }
        async void SaveButtonClicked(object sender, EventArgs e)
        {
            SearchObject searchObject = new SearchObject();

            searchObject.SearchLocation = Location;
            searchObject.Category       = SubCategory.Value != null ? new KeyValuePair <object, object>(SubCategory.Value, SubCategory.Key) : new KeyValuePair <object, object>(Category.Key, Category.Value);
            searchObject.SearchItems    = this.SearchItems;
            searchObject.Conditions     = this.Conditions;
            searchObject.MaxListings    = this.MaxListings;
            searchObject.PostedDate     = this.WeeksOld;

            string serialized = JsonConvert.SerializeObject(searchObject);
            await AppDelegate.databaseConnection.AddNewSearchAsync(Location.Url, serialized);

            serialized = null;

            Console.WriteLine(AppDelegate.databaseConnection.StatusMessage);

            if (AppDelegate.databaseConnection.StatusCode == codes.ok)
            {
                UIAlertView alert = new UIAlertView();
                alert.Message = "Search Saved!";
                alert.AddButton("OK");
                alert.Show();

                this.NavigationItem.RightBarButtonItem.Enabled = false;
            }
            else
            {
                UIAlertView alert = new UIAlertView();
                alert.Message = string.Format("Oops, something went wrong{0}Please try again...", Environment.NewLine);
                alert.AddButton("OK");
                alert.Show();

                this.NavigationItem.RightBarButtonItem.Enabled = true;
            }

            searchObject = null;
        }
Esempio n. 37
0
        public string getDialogText()
        {
            UIAlertView alert = new UIAlertView();

            alert.Title = "Title";                                  //title of alert box
            alert.AddButton("OK");                                  //button title
            alert.Message        = "Please Enter a Value.";         //text
            alert.AlertViewStyle = UIAlertViewStyle.PlainTextInput; //input
            alert.Clicked       += (object s, UIButtonEventArgs ev) => {
                Text = alert.GetTextField(0).Text;
                UIAlertView alertText = new UIAlertView();
                alertText.Title = "Entered Text:"; //title of alert box
                alertText.AddButton("OK");         //button title
                alertText.Message = Text;          //text
                alertText.Show();
                // handle click event here
                // user input will be in alert.GetTextField(0).Text;
            };

            alert.Show();
            return(Text);
        }
Esempio n. 38
0
        public override void Clicked(UIAlertView alertview, nint buttonIndex)
        {
            uiAlertView = alertview;
            if (buttonIndex != alertview.CancelButtonIndex)
            {
                alertview.GetTextField(0).ResignFirstResponder();
                int pageNum = 0;

                if (int.TryParse(alertview.GetTextField(0).Text, out pageNum) && pageNum > 0 && (pageNum <= pdfviewer.PageCount))
                {
                    pdfviewer.GoToPage(pageNum);
                }
                else
                {
                    alert = new UIAlertView();
                    alert.AlertViewStyle = UIAlertViewStyle.Default;
                    alert.AddButton("OK");
                    alert.Title = "Invalid Page Number";
                }
            }
            nsObject = NSNotificationCenter.DefaultCenter.AddObserver((NSString)"UIKeyboardDidHideNotification", KeyboardDidHide);
        }
Esempio n. 39
0
 public void checkLogin()
 {
     if (usernameTxtF.HasText == false)
     {
         UIAlertView alert = new UIAlertView()
         {
             Title = "Username is blank", Message = "Please enter a username."
         };
         alert.AddButton("Ok");
         alert.Show();
         correctLogin = false;
     }
     else if (passwordTxtF.HasText == false)
     {
         UIAlertView alert = new UIAlertView()
         {
             Title = "Password is blank", Message = "Please enter a password."
         };
         alert.AddButton("Ok");
         alert.Show();
         correctLogin = false;
     }
     else if (loginCorrect(usernameTxtF.Text, passwordTxtF.Text) == false)
     {
         UIAlertView alert = new UIAlertView()
         {
             Title = "Username/password is incorrect", Message = "Please try again."
         };
         alert.AddButton("Ok");
         alert.Show();
         correctLogin = false;
     }
     else
     {
         //username and password are correct
         correctLogin = true;
     }
 }
Esempio n. 40
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            string  message = "";
            UILabel label   = new UILabel();

            label.Frame           = new RectangleF(10, 10, 100, 100);
            label.BackgroundColor = UIColor.Orange;
            label.Text            = "First";
            label.TextAlignment   = UITextAlignment.Center;

            UIButton button = new UIButton();

            button.Frame           = new RectangleF(10, 170, 100, 30);
            button.BackgroundColor = UIColor.LightGray;
            button.TouchUpInside  += (sender, e) => {
                if (this.NavigationController == null)
                {
                    message = "no nav";
                }
                else
                {
                    message = "have nav";
                }
                Console.WriteLine(this.ParentViewController.ToString());
                UIAlertView alert = new UIAlertView();
                alert.Title   = "½á¹û";
                alert.Message = message;
                alert.AddButton("cancel");
                alert.Show();
            };


            this.View.AddSubview(label);
            this.View.AddSubview(button);
        }
Esempio n. 41
0
        private void SaveClick(object sender, EventArgs e)
        {
            _textFieldName.ResignFirstResponder();

            // Check for empty textboxes
            if (string.IsNullOrEmpty(_textFieldName.Text))
            {
                UIAlertView alertView = new UIAlertView();
                alertView.AddButton("Close");
                alertView.Title   = "Woops";
                alertView.Message = "Please enter your category name";
                alertView.Show();

                return;
            }

            // Save the category
            _category.Name   = _textFieldName.Text;
            _category.Active = _switchActive.On;
            Category.Save(_category);

            NavigationController.PopViewControllerAnimated(true);
        }
        internal void SaveButton_TouchUpInside(object sender, EventArgs e)
        {
            Stream stream = new MemoryStream();

            stream = parent.pdfViewerControl.SaveDocument();
            string path     = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            string filepath = Path.Combine(path, "savedDocument.pdf");

            FileStream outputFillStream = File.Open(filepath, FileMode.Create);

            stream.Position = 0;
            stream.CopyTo(outputFillStream);
            outputFillStream.Close();

            UIAlertView alertview = new UIAlertView();

            alertview.Frame   = new CGRect(20, 100, 200, 200);
            alertview.Message = filepath;
            alertview.Title   = "The modified document is saved in the below location.";
            alertview.AddButton("Ok");
            alertview.Show();
            parent.annotHelper.RemoveAllToolbars(false);
        }
Esempio n. 43
0
            public override void DidScan(BarcodePicker picker, IScanSession session)
            {
                if (session.NewlyRecognizedCodes.Count > 0)
                {
                    Barcode code = session.NewlyRecognizedCodes.GetItem <Barcode>(0);
                    Console.WriteLine("barcode scanned: {0}, '{1}'", code.SymbologyString, code.Data);

                    // Pause the scanner directly on the session.
                    session.PauseScanning();

                    // If you want to edit something in the view hierarchy make sure to run it on the UI thread.
                    UIApplication.SharedApplication.InvokeOnMainThread(() => {
                        UIAlertView alert = new UIAlertView()
                        {
                            Title   = code.SymbologyString + " Barcode Detected",
                            Message = "" + code.Data
                        };
                        alert.AddButton("OK");

                        alert.Show();
                    });
                }
            }
Esempio n. 44
0
        public override nint GetItemsCount(UICollectionView collectionView, nint section)
        {
            nint cou = 0;

            try
            {
                cou = myData.ItemList.Count;
                //myData.ErrorDescription
            }
            catch (Exception ex)
            {
                LoggingClass.LogError(ex.Message, screen, ex.StackTrace.ToString());
                UIAlertView alert = new UIAlertView()
                {
                    Title   = "Sorry",
                    Message = "Something went wrong. We are on it"
                };

                alert.AddButton("OK");
                alert.Show();
            }
            return(cou);
        }
Esempio n. 45
0
        public static void ShowAlert(string title, string message)
        {
            void Show()
            {
                var alert = new UIAlertView
                {
                    Title   = title,
                    Message = message
                };

                alert.AddButton("Ok");
                alert.Show();
            }

            if (NSThread.Current.IsMainThread)
            {
                Show();
            }
            else
            {
                NSRunLoop.Main.BeginInvokeOnMainThread(Show);
            }
        }
Esempio n. 46
0
        public void GetPromoData(int idTienda)
        {
            if (!Reachability.IsHostReachable("www.codecags.com"))
            {
                var alert = new UIAlertView {
                    Title   = "Unable to connect to server",
                    Message = "Verify network connections"
                };
                alert.AddButton("OK");
                alert.Show();
            }
            else
            {
                var client  = new RestClient("http://codecags.com");
                var request = new RestRequest("jsonPromos.php", Method.POST);

                request.RequestFormat = DataFormat.Json;
                request.AddParameter("idTienda", idTienda);
                var response = client.Execute(request);
                RestSharp.Deserializers.JsonDeserializer deserial = new JsonDeserializer();
                jsonPromos = deserial.Deserialize <List <JsonPromos> > (response);
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            btnGuardar.TouchUpInside += async delegate
            {
                Mensaje.Title = "Guardar En Azure";
                Mensaje.AddButton("Aceptar");
                Mensaje.Show();
                try
                {
                    nombre    = txtNombre.Text;
                    domicilio = txtDomicilio.Text;
                    correo    = txtCorreo.Text;
                    edad      = txtEdad.Text;
                    saldo     = double.Parse(txtSaldo.Text);
                    CurrentPlatform.Init();
                    Dineros datos = new Dineros
                    {
                        Nombre    = nombre,
                        Domicilio = domicilio,
                        Correo    = correo,
                        Edad      = edad,
                        Saldo     = saldo,
                    };
                    await AppDelegate.MobileService.GetTable <Dineros>().InsertAsync(datos);

                    {
                        Mensaje.Message = "Guardado En Azure Correctamente";
                        Mensaje.Show();
                    }
                }
                catch (Exception ex)
                {
                    Mensaje.Message = ex.Message;
                }
            };
        }
Esempio n. 48
0
 private void FoundTransfer(object sender, EventArgs e)
 {
     if ((acccountmaskedEdit.Value == null || acccountmaskedEdit.Value.ToString() == string.Empty) ||
         (descriptionmaskedEdit.Value == null || descriptionmaskedEdit.Value.ToString() == string.Empty) ||
         (amountmaskedEdit.Value == null || amountmaskedEdit.Value.ToString() == string.Empty) ||
         (emailIDmaskedEdit.Value == null || emailIDmaskedEdit.Value.ToString() == string.Empty) ||
         (mobileNumbermaskedEdit.Value == null || mobileNumbermaskedEdit.Value.ToString() == string.Empty))
     {
         UIAlertView v = new UIAlertView();
         v.Title   = "Results";
         v.Message = "Please fill all the required data!";
         v.AddButton("OK");
         v.Show();
     }
     else if (acccountmaskedEdit.HasError || descriptionmaskedEdit.HasError || amountmaskedEdit.HasError || emailIDmaskedEdit.HasError || mobileNumbermaskedEdit.HasError)
     {
         UIAlertView v = new UIAlertView();
         v.Title   = "Results";
         v.Message = "Please enter valid details";
         v.AddButton("OK");
         v.Show();
     }
     else
     {
         UIAlertView v1 = new UIAlertView();
         v1.Title = "Results";
         v1.AddButton("OK");
         v1.Message = string.Format("Amount of {0} has been transferred successfully!", amountmaskedEdit.Text);
         v1.Show();
         acccountmaskedEdit.Value     = string.Empty;
         descriptionmaskedEdit.Value  = string.Empty;
         amountmaskedEdit.Value       = string.Empty;
         emailIDmaskedEdit.Value      = string.Empty;
         mobileNumbermaskedEdit.Value = string.Empty;
     }
     this.BecomeFirstResponder();
 }
Esempio n. 49
0
        partial void UIButton118_TouchUpInside(UIButton sender)
        {
            db_inter = new Database_interaction();
            bool   parseOK;
            string name      = lblname.Text;
            string costvalue = lblcost.Text;
            float  cost;

            parseOK = float.TryParse(costvalue, out cost);
            if (!parseOK)
            {
                UIAlertView alert1 = new UIAlertView()
                {
                    Title   = "Error",
                    Message = "The Cost Must Be digit!!"
                };
                alert1.AddButton("OK");
                alert1.Show();
                return;
            }
            string   type    = lbltype.Text;
            DateTime date    = tempDate;         //picker's time
            string   details = lbldetails.Text;


            db_inter.AddCost(new Cost(name, cost, type, date, details));            //add cost


            UIAlertView alert2 = new UIAlertView()
            {
                Title   = "Add Successfully",
                Message = "The Cost has been added!!"
            };

            alert2.AddButton("OK");
            alert2.Show();
        }
Esempio n. 50
0
 void BizeYazinGonder()
 {
     if (BosVarmi())
     {
         var        Me         = DataBase.MEMBER_DATA_GETIR()[0];
         WebService webService = new WebService();
         ContactDTO contactDTO = new ContactDTO()
         {
             text   = MesajTextView.Text,
             topic  = textField.Text,
             userId = Me.id
         };
         string jsonString = JsonConvert.SerializeObject(contactDTO);
         var    Donus      = webService.ServisIslem("contacts", jsonString);
         if (Donus != "Hata")
         {
             var alert = new UIAlertView();
             alert.Title = "Buptis";
             alert.AddButton("Tamam");
             alert.Message        = "Destek talebiniz iletildi. Teşekkürler...";
             alert.AlertViewStyle = UIAlertViewStyle.Default;
             alert.Clicked       += (object s, UIButtonEventArgs ev) =>
             {
                 alert.Dispose();
                 this.DismissViewController(true, null);
             };
             alert.Show();
             textField.Text     = "";
             MesajTextView.Text = "";
         }
         else
         {
             CustomAlert.GetCustomAlert(this, "Bir sorun oluştu...");
             return;
         }
     }
 }
Esempio n. 51
0
        public override void ViewDidAppear(bool animated)
        {
            NavigationController.NavigationBar.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile("images/blue.png"));
            float border    = 0;
            float gridHight = (View.Frame.Height - border) / elements.Count;
            float gridWidh  = View.Frame.Width;
            float ypos      = 0;
            float xpos      = 0;

            for (int i = 0; i < elements.Count; i++)
            {
                elements[i].Frame = new RectangleF(xpos + border, ypos + border, gridWidh - 2 * border, gridHight - border);
                View.AddSubview(elements[i]);

                ypos += gridHight;
            }


            if (GymSettingsDataSource.UserName == null || GymSettingsDataSource.Password == null)
            {
                NavigationController.PushViewController(new GymSettingsViewController(), true);
            }
            else
            {
                TTTHttp.LogOn();
            }

            if (TTTHttp.isError)
            {
                UIAlertView alert = new UIAlertView();
                alert.Title   = "Påloggingsfeil";
                alert.Message = Text.getString(TTTHttp.ErrorMessage);
                alert.AddButton("OK");
                alert.Show();
                NavigationController.PushViewController(new GymSettingsViewController(), true);
            }
        }
Esempio n. 52
0
        private void ButtonAddFunc()
        {
            mut.WaitOne();
            //Add to Table cell

            InvokeOnMainThread(delegate
            {
                Cost plannedcost = new Cost(txtname.Text, float.Parse(txtValue.Text), "", DateTime.Now, "");
                AddNewItem(plannedcost);
                //update the Label
                plannedcostlist.Add(plannedcost);

                float totalplannedcost = 0;
                foreach (Cost c in plannedcostlist)
                {
                    totalplannedcost += c.CostValue;
                }
                lblTotalCostPlanned.Text = "Total Cost Planned: " + totalplannedcost.ToString();

                lblRemaningBudget.Text = "Remaining Budget: " + (budget.BudgetAmount - totalcost - totalplannedcost).ToString();

                if ((budget.BudgetAmount - totalcost - totalplannedcost + plannedcost.CostValue) > 0 && (budget.BudgetAmount - totalcost - totalplannedcost) <= 0)
                {
                    UIAlertView alert = new UIAlertView()
                    {
                        Title   = "Warning!!",
                        Message = "You are out of Budget!!!"
                    };
                    alert.AddButton("OK");
                    alert.Show();
                }
            });


            mut.ReleaseMutex();
        }
Esempio n. 53
0
        private void Share(ShareViewModel source)
        {
            var window   = UIApplication.SharedApplication.KeyWindow;
            var subviews = window.Subviews;
            var view     = subviews.Last();
            var frame    = view.Frame;

            var uidic = UIDocumentInteractionController.FromUrl(new NSUrl(source.FileName, true));

            if (!uidic.PresentPreview(true))
            {
                var rc = uidic.PresentOpenInMenu(frame, view, true);
                if (!rc)
                {
                    UIAlertView alert = new UIAlertView()
                    {
                        Title   = AppResources.FAILED_TO_OPEN_ATTACHMENT,
                        Message = AppResources.ATTACHMENT_FILE_TYPE_NOT_SUPPORTED
                    };
                    alert.AddButton(AppResources.OK);
                    alert.Show();
                }
            }
        }
Esempio n. 54
0
        public void SetNotificationForException(DateTime dateTime, string title, string message)
        {
            UIAlertView alert = new UIAlertView()
            {
                Title   = title,
                Message = message
            };

            alert.AddButton("Ok");
            alert.Show();

            //StartWakefulService(Android.App.Application.Context, intent);
            //CompleteWakefulIntent(intent);

            //NofiticationReceiver.CompleteWakefulIntent(intent);
            //PendingIntent alarmIntent = PendingIntent.GetBroadcast(Android.App.Application.Context, 0, intent, 0);

            var millsTillTriger = (long)dateTime.TimeOfDay.Subtract(DateTime.Now.TimeOfDay).TotalMilliseconds;

            Task.Delay(TimeSpan.FromSeconds(millsTillTriger));

            //alarmMgr.Set(AlarmType.RtcWakeup, Java.Lang.JavaSystem.CurrentTimeMillis() + millsTillTriger,
            //alarmIntent);
        }
Esempio n. 55
0
        private static Task <int?> PlatformShow(string title, string description, List <string> buttons)
        {
            tcs = new TaskCompletionSource <int?>();
            UIApplication.SharedApplication.InvokeOnMainThread(delegate
            {
                alert         = new UIAlertView();
                alert.Title   = title;
                alert.Message = description;
                foreach (string button in buttons)
                {
                    alert.AddButton(button);
                }
                alert.Dismissed += (sender, e) =>
                {
                    if (!tcs.Task.IsCompleted)
                    {
                        tcs.SetResult((int)e.ButtonIndex);
                    }
                };
                alert.Show();
            });

            return(tcs.Task);
        }
Esempio n. 56
0
 /*
  * Function to bind all the keypad buttons to the ViewModel
  */
 private void BindButton()
 {
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.oneButton, Observable.Return(oneButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.twoButton, Observable.Return(twoButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.threeButton, Observable.Return(threeButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.fourButton, Observable.Return(fourButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.fiveButton, Observable.Return(fiveButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.sixButton, Observable.Return(sixButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.sevenButton, Observable.Return(sevenButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.eightButton, Observable.Return(eightButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.nineButton, Observable.Return(nineButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.UpdateCommand, v => v.zeroButton, Observable.Return(zeroButton.TitleLabel.Text));
     this.BindCommand(this.ViewModel, vm => vm.LoginCommand, v => v.LoginButton);
     ViewModel.LoginCommand.Subscribe(success => {
         if (success)
         {
             WelcomeController welcome = this.Storyboard.InstantiateViewController("WelcomeController") as WelcomeController;
             if (welcome != null)
             {
                 welcome.userName = ViewModel.Role;
                 this.NavigationController.PushViewController(welcome, true);
             }
         }
         else
         {
             UIAlertView alert = new UIAlertView()
             {
                 Title   = "Error",
                 Message = "Wrong Passcode"
             };
             alert.AddButton("OK");
             alert.Show();
         }
     });
     this.BindCommand(this.ViewModel, vm => vm.ResetCommand, v => v.clrButton);
 }
Esempio n. 57
0
        /// <summary>Displays alert to user.</summary>
        /// <param name="title">The title.</param>
        /// <param name="message">The message.</param>
        /// <exception cref="ArgumentNullException"> when <paramref name="title"/> or <paramref name="message"/> is null. </exception>
        private void ShowAlert(string title, string message)
        {
            if (title == null)
            {
                throw new ArgumentNullException(nameof(title));
            }
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            if (this.LoginActivityIndicator.IsAnimating)
            {
                this.LoginActivityIndicator.StopAnimating();
            }

            var alert = new UIAlertView()
            {
                Title = title, Message = message
            };

            alert.AddButton("Ok");
            alert.Show();
        }
Esempio n. 58
0
        public TUM(IntPtr handle) : base(handle)
        {
            Title = NSBundle.MainBundle.LocalizedString("TUM", "TUM");
            View.BackgroundColor = UIColor.White;
            webView = new UIWebView(View.Bounds);
            webView.ScrollView.ContentInset = new UIEdgeInsets(0, 0, 45, 0);
            View.AddSubview(webView);
            url = "http://ios.tum.pt/index.html";
            webView.ScalesPageToFit = true;


            if (!Reachability.IsHostReachable("tum.pt"))
            {
                UIAlertView alert = new UIAlertView();
                alert.Title = "Sem ligação à rede";
                alert.AddButton("Continuar");
                alert.Message = "Não conseguirá usar a aplicação sem conexão à rede.";
                alert.Show();
            }
            else
            {
                webView.LoadRequest(new NSUrlRequest(new NSUrl(url)));
            }
        }
        public void ShowPopup(EntryPopup popup)
        {
            var alert = new UIAlertView
            {
                Title          = popup.Title,
                Message        = popup.Text,
                AlertViewStyle = UIAlertViewStyle.PlainTextInput
            };

            foreach (var b in popup.Buttons)
            {
                alert.AddButton(b);
            }

            alert.Clicked += (s, args) =>
            {
                popup.OnPopupClosed(new EntryPopupClosedArgs
                {
                    Button = popup.Buttons.ElementAt(Convert.ToInt32(args.ButtonIndex)),
                    Text   = alert.GetTextField(0).Text
                });
            };
            alert.Show();
        }
Esempio n. 60
0
        void OnAuthenticationCompleted(object sender, AuthenticatorCompletedEventArgs e)
        {
            //App.SuccessfulLoginAction.Invoke();
            UIAlertView alert = new UIAlertView()
            {
                Title = "確認"
            };

            alert.AddButton("OK");
            if (e.IsAuthenticated)
            {
                //App.Instance.SuccessfulLoginAction.Invoke();
                // Use eventArgs.Account to do wonderful things
                //App.OAuth2Settings.SaveToken(e.Account.Properties["access_token"]);
                alert.Message = "認証成功";
                alert.Show();
            }
            else
            {
                // The user cancelled
                alert.Message = "認証キャンセル";
                alert.Show();
            }
        }