コード例 #1
0
        private PrivateEmailGeneratedWindowController(PrivateEmailsManagerViewModel model) : base("PrivateEmailGeneratedWindow")
        {
            __Model = model;

            __Model.OnError += __Model_OnError;

            __Model.OnWillExecute += (sender) =>
            {
                GuiProgressIndicator.StartAnimation(this);
                this.Window.ContentView = GuiInProgressView;
            };

            __Model.OnDidExecute += (sender) =>
            {
                GuiProgressIndicator.StopAnimation(this);
                this.Window.ContentView = GuiMainView;

                if (__NeedToCloseWindow)
                {
                    Close();
                }
            };

            __Model.OnNewEmailGenerated += (PrivateEmailInfo emailInfo) =>
            {
                __GeneratedEmailInfo = emailInfo;

                GuiGeneratedEmailField.StringValue = emailInfo.Email;
                GuiForwardToEmailField.StringValue = emailInfo.ForwardToEmail;
                GuiNotesField.TextStorage.SetString(new NSAttributedString(emailInfo.Notes));
            };
        }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (GuiButtonLogIn != null)
            {
                GuiButtonLogIn.Dispose();
                GuiButtonLogIn = null;
            }

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

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

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

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

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

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

            if (GuiTextAccountIdDescription != null)
            {
                GuiTextAccountIdDescription.Dispose();
                GuiTextAccountIdDescription = null;
            }
        }
コード例 #3
0
        public void SetViewModel(ViewModelLogIn viewModel) 

        {
            
 __LogInViewModel = viewModel;

            __LogInViewModel.OnAccountCredentailsError += __LogInViewModel_OnAccountCredentailsError;

            __LogInViewModel.OnWillExecute += (sender) =>
            {
                EnableView.Disable(View, ignoreControls: new List <NSControl> {
                    GuiButtonLogIn
                });
                CustomButtonStyles.ApplyStyleMainButton(GuiButtonLogIn, LocalizedStrings.Instance.LocalizedString("Button_Cancel"));
                GuiProgressIndicator.Hidden = false;
                GuiProgressIndicator.StartAnimation(this);
            };

            __LogInViewModel.OnDidExecute += (sender) =>
            {
                GuiButtonLogIn.Hidden = false;

                EnableView.Enable(View, ignoreControls: new List <NSControl> {
                    GuiButtonLogIn
                });
                CustomButtonStyles.ApplyStyleMainButton(GuiButtonLogIn, LocalizedStrings.Instance.LocalizedString("Button_LogIn"));
                GuiProgressIndicator.Hidden = true;
                GuiProgressIndicator.StopAnimation(this);
            };

            __LogInViewModel.OnError += __LogInViewModel_OnError;

            __LogInViewModel.OnAccountSuspended += (AccountStatus session) =>
            {
                ShowAccountExpireDialog(session);
            };

            __LogInViewModel.PropertyChanged += (sender, e) =>
            {
                __LogInViewModel_PropertyChanged(sender, e);
            };
        }