コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (ValidationLabel != null)
            {
                ValidationLabel.Dispose();
                ValidationLabel = null;
            }

            if (PasswordTextField != null)
            {
                PasswordTextField.Dispose();
                PasswordTextField = null;
            }

            if (UsernameTextField != null)
            {
                UsernameTextField.Dispose();
                UsernameTextField = null;
            }
        }
コード例 #2
0
        public void Login()
        {
            _browser.Navigate().GoToUrl(MarketingCloudUrl);

            UsernameTextField.SendKeys(Username);
            PasswordTextField.SendKeys(Password);
            LoginButton.Click();
        }
コード例 #3
0
        public void FillLoginForm(string username, string password)
        {
            //Enter the Username in the Username field
            UsernameTextField.EnterTextInTextField(username);

            //Enter the password in the password field
            PasswordTextField.EnterTextInTextField(password);
        }
コード例 #4
0
 bool UsernameTextField_ShouldReturn(UITextField textField)
 {
     if (PasswordTextField.Text == string.Empty)
     {
         return(PasswordTextField.BecomeFirstResponder());
     }
     else if (UsernameTextField.Text == string.Empty)
     {
         return(UsernameTextField.BecomeFirstResponder());
     }
     else
     {
         logIn();
         View.EndEditing(true);
     }
     return(true);
 }
コード例 #5
0
        void ReleaseDesignerOutlets()
        {
            if (AddImageButton != null)
            {
                AddImageButton.Dispose();
                AddImageButton = null;
            }

            if (EmailTextField != null)
            {
                EmailTextField.Dispose();
                EmailTextField = null;
            }

            if (PasswordTextField != null)
            {
                PasswordTextField.Dispose();
                PasswordTextField = null;
            }

            if (RegisterButton != null)
            {
                RegisterButton.Dispose();
                RegisterButton = null;
            }

            if (UsernameTextField != null)
            {
                UsernameTextField.Dispose();
                UsernameTextField = null;
            }

            if (UserTagTextField != null)
            {
                UserTagTextField.Dispose();
                UserTagTextField = null;
            }

            if (ErrorLabel != null)
            {
                ErrorLabel.Dispose();
                ErrorLabel = null;
            }
        }
コード例 #6
0
        void ReleaseDesignerOutlets()
        {
            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (LoginView != null)
            {
                LoginView.Dispose();
                LoginView = null;
            }

            if (PasswordTextField != null)
            {
                PasswordTextField.Dispose();
                PasswordTextField = null;
            }

            if (PasswordUiLabel != null)
            {
                PasswordUiLabel.Dispose();
                PasswordUiLabel = null;
            }

            if (UsernameTextField != null)
            {
                UsernameTextField.Dispose();
                UsernameTextField = null;
            }

            if (UsernameUiLabel != null)
            {
                UsernameUiLabel.Dispose();
                UsernameUiLabel = null;
            }
        }
コード例 #7
0
 public void EnterUsername(String username)
 {
     UsernameTextField.SendKeys(username);
 }
コード例 #8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            //Button.AccessibilityIdentifier = "myButton";
            //Button.TouchUpInside += delegate {
            //	var title = string.Format ("{0} clicks!", count++);
            //	Button.SetTitle (title, UIControlState.Normal);
            //};

            #region Include Return Button in Keyboard
            this.UsernameTextField.ShouldReturn += (textField) =>
            {
                UsernameTextField.ResignFirstResponder();
                return(true);
            };

            this.PasswordTextField.ShouldReturn += (textField) =>
            {
                PasswordTextField.ResignFirstResponder();
                return(true);
            };
            #endregion

            #region When Clicked out side keyboard, Close the Keyboard
            UITapGestureRecognizer g_recognizer = new UITapGestureRecognizer(() =>
            {
                UsernameTextField.ResignFirstResponder();
                PasswordTextField.ResignFirstResponder();
            });
            this.View.AddGestureRecognizer(g_recognizer);
            #endregion

            #region Add Next Previous Buttons to Toolbar
            UsernameTextField.InputAccessoryView = new NextPreviousToolBar(UsernameTextField, null, PasswordTextField);
            PasswordTextField.InputAccessoryView = new NextPreviousToolBar(PasswordTextField, UsernameTextField, null);
            #endregion

            #region Move UI View Up Handling
            // Keyboard popup
            _didShowNotificationObserver = NSNotificationCenter.DefaultCenter.AddObserver
                                               (UIKeyboard.DidShowNotification, KeyBoardDidShow, this);

            // Keyboard Down
            _willHideNotificationObserver = NSNotificationCenter.DefaultCenter.AddObserver
                                                (UIKeyboard.WillHideNotification, KeyBoardWillHide, this);
            #endregion


            LoginButton.TouchUpInside += delegate
            {
                try
                {
                    Core.Connect(UsernameTextField.Text, PasswordTextField.Text);
                    authenticator.CreateAccount(UsernameTextField.Text, PasswordTextField.Text);
                    //account = new Account(UsernameTextField.Text, Core.PopulateCredentials(UsernameTextField.Text, PasswordTextField.Text));
                    //AccountStore.Create().Save(account, CREDENTIALS_NAME);
                    this.NavigationController.PushViewController(mainView, true);
                    UsernameTextField.Text = "";
                    PasswordTextField.Text = "";
                    View.EndEditing(true);

                    //Core.Login();
                }
                catch (Exception ex)
                {
                    //TODO JR: add error handling dialog
                }
            };
        }
コード例 #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.

            var set = this.CreateBindingSet <BaseUserViewController, BaseUserViewModel>();

            //set.Bind(TakeButton).To(vm => vm.TakePictureCommand);
            //set.Bind(PhotoImageTapGestureRecognizer).To(vm => vm.ChoosePictureCommand);
            //set.Bind(LoginButton).To(vm => vm.LoginCommand);
            set.Bind <UITextField>(CompanyNameTextField).To(vm => vm.CompanyName);
            set.Bind <UITextField>(FullNameTextField).To(vm => vm.FullName);
            set.Bind <UITextField>(UsernameTextField).To(vm => vm.Username);
            set.Bind <UITextField>(PasswordTextField).To(vm => vm.Password);
            set.Bind <UITextField>(ConfirmPasswordTextField).To(vm => vm.ConfirmPassword);
            // set.Bind(AddButtonItem).To(vm => vm.AddUserCommand);
            set.Bind <UIImageView>(PhotoImageView).To(vm => vm.PhotoDataBytes).WithConversion("InMemoryImage");
            set.Apply();

            PropertiesTapGestureRecognizer.AddTarget(() =>
            {
                var controller = this.CreateViewControllerFor <PropertyPickerViewModel>(new
                {
                    viewOnlyMode             = !Editing,
                    jsonSelectedPropertyList = JsonConvert.SerializeObject(ViewModel.Properties),
                    requestedViewId          = ViewModel.ViewInstanceId,
                    userId = ViewModel.UserId
                }) as PropertyPickerViewController;

                NavigationController.PushViewController(controller, true);
            });

            PhotoImageTapGestureRecognizer.AddTarget(() =>
            {
                if (Editing)
                {
                    if (Runtime.Arch == Arch.DEVICE)
                    {
                        ViewModel.TakePictureCommand.Execute(null);
                    }
                    else if (Runtime.Arch == Arch.SIMULATOR)
                    {
                        ViewModel.ChoosePictureCommand.Execute(null);
                    }
                }
            });

            ViewModel.OnPictureEventHandler += (object sender, EventArgs e) => {
                PlaceholderImageView.Hidden = true;
            };

            ViewModel.OnPictureCancelledEventHandler += (object sender, EventArgs e) => {
            };

            // Dismiss view controller after user added
            //ViewModel.AddUserSuccessEventHandler += (object sender, EventArgs e) => NavigationController.PopViewControllerAnimated (true);

            // CancelButtonItem.Clicked += (object sender, EventArgs e) => NavigationController.PopViewControllerAnimated (true);

            FullNameTextField.ShouldReturn += (textField) => {
                textField.ResignFirstResponder();
                UsernameTextField.BecomeFirstResponder();
                return(true);
            };

            UsernameTextField.ShouldReturn += (textField) => {
                textField.ResignFirstResponder();
                PasswordTextField.BecomeFirstResponder();
                return(true);
            };

            PasswordTextField.ShouldReturn += (textField) => {
                textField.ResignFirstResponder();
                ConfirmPasswordTextField.BecomeFirstResponder();
                return(true);
            };

            // Done button pressed
            ConfirmPasswordTextField.ShouldReturn += (textField) => {
                textField.ResignFirstResponder();
                return(true);
            };

            SetEditing(true, false);
        }