Ejemplo n.º 1
0
        /// <summary>
        /// Displays the login window
        /// </summary>
        private void ShowLoginWindow()
        {
            // Only display if the user id is not specified
            if (ContextModel.Instance.UserID == Guid.Empty)
            {
                LoginChildWindow window = new LoginChildWindow();
                window.Closed += new EventHandler(LoginWindowClosed);

                window.Show();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Event handler for when the login window is closed
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event args</param>
        void LoginWindowClosed(object sender, EventArgs e)
        {
            LoginChildWindow cw = (LoginChildWindow)sender;

            if (cw.DialogResult == true)
            {
                ContextModel.Instance.LoginAsync(cw.UserName);
            }
            else
            {
                // Don't allow close to happen
                ShowLoginWindow();
            }
        }