Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
		}
Exemplo n.º 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;
        }