Exemple #1
0
        public static string ShowKeyboardInput(
            PlayerIndex player,
            string title,
            string description,
            string defaultText,
            bool usePasswordMode)
        {
            string result = defaultText;

            TextFieldAlertView myAlertView = new TextFieldAlertView(usePasswordMode, title, defaultText);


            myAlertView.Title   = title;
            myAlertView.Message = description;

            myAlertView.Clicked += delegate(object sender, UIButtonEventArgs e)
            {
                if (e.ButtonIndex == 1)
                {
                    result = ((UIAlertView)sender).Subviews.OfType <UITextField>().Single().Text;
                }
            };
            myAlertView.Transform = MonoTouch.CoreGraphics.CGAffineTransform.MakeTranslation(0f, 110f);
            myAlertView.Show();

            return(result);
        }
Exemple #2
0
        public static string ShowKeyboardInput(
            PlayerIndex player,
            string title,
            string description,
            string defaultText,
            bool usePasswordMode)
        {
            string result = defaultText;

            if (!isKeyboardInputShowing)
            {
                isKeyboardInputShowing = true;

                TextFieldAlertView myAlertView = new TextFieldAlertView(usePasswordMode, title, defaultText);


                myAlertView.Title   = title;
                myAlertView.Message = description;

                myAlertView.Clicked += delegate(object sender, UIButtonEventArgs e)
                {
                    if (e.ButtonIndex == 1)
                    {
                        result = ((UIAlertView)sender).Subviews.OfType <UITextField>().Single().Text;
                        isKeyboardInputShowing = false;
                    }
                };

                myAlertView.Dismissed += delegate(object sender, UIButtonEventArgs e)
                {
                    result = defaultText;
                    isKeyboardInputShowing = false;
                };

                myAlertView.Transform = CoreGraphics.CGAffineTransform.MakeTranslation(0f, 110f);

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

            isVisible = isKeyboardInputShowing;
            return(result);
        }
Exemple #3
0
		public static string ShowKeyboardInput(
		 PlayerIndex player,           
         string title,
         string description,
         string defaultText,
		 bool usePasswordMode)
		{
			string result = defaultText; 

			TextFieldAlertView myAlertView = new TextFieldAlertView(usePasswordMode, title, defaultText);


			myAlertView.Title = title;
			myAlertView.Message = description;

			myAlertView.Clicked += delegate(object sender, UIButtonEventArgs e)
					{
						if (e.ButtonIndex == 1)
						{
								result = ((UIAlertView) sender).Subviews.OfType<UITextField>().Single().Text;
						}
					};
			myAlertView.Transform = MonoTouch.CoreGraphics.CGAffineTransform.MakeTranslation (0f, 110f);
			myAlertView.Show();

			return result;
		}
Exemple #4
0
        public static string ShowKeyboardInput(
		 PlayerIndex player,           
         string title,
         string description,
         string defaultText,
		 bool usePasswordMode)
        {
            string result = defaultText;
            if (!isKeyboardInputShowing)
            {
                isKeyboardInputShowing = true;

                TextFieldAlertView myAlertView = new TextFieldAlertView(usePasswordMode, title, defaultText);

                myAlertView.Title = title;
                myAlertView.Message = description;

                myAlertView.Clicked += delegate(object sender, UIButtonEventArgs e)
                        {
                            if (e.ButtonIndex == 1)
                            {
                                    result = ((UIAlertView) sender).Subviews.OfType<UITextField>().Single().Text;
                                    isKeyboardInputShowing = false;
                            }
                        };

                myAlertView.Dismissed += delegate(object sender, UIButtonEventArgs e)
                                {
                                    result = defaultText;
                                    isKeyboardInputShowing = false;
                                };

                myAlertView.Transform = MonoTouch.CoreGraphics.CGAffineTransform.MakeTranslation (0f, 110f);

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

            isVisible = isKeyboardInputShowing;
            return result;
        }