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); }
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); }
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; }
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; }