Exemplo n.º 1
0
        /////////////////////////////////////////////////////////////////////////////////

        #region Logout Actions
        /////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Performs the logout action for the current user
        /// </summary>
        /// <param name="pluginManager"></param>
        /// <param name="user"></param>
        public static void LogoutUser(IPluginManager pluginManager, UserClient user)
        {
            System.Threading.Thread th = new System.Threading.Thread(
                new System.Threading.ThreadStart(delegate { DoLogout(user); })
                );
            th.Start();

            // change the buttons
            pluginManager.DisplayLoggedOutButtons();

            // clean up previous search contents (privacy concern)
            ISearchSnippetForm searchForm = pluginManager.FindWindow <ISearchSnippetForm>();

            if (searchForm != null)
            {
                searchForm.DisplayCleanForm();
            }

            // clean up previous publish info
            IPublishSnippetForm publishForm = pluginManager.FindWindow <IPublishSnippetForm>();

            if (publishForm != null)
            {
                publishForm.ResetResults();
            }

            // close publish window
            pluginManager.ClosePublishSnippetWindow();

            // close addSnippet Window
            pluginManager.CloseAddSnippetWindow();

            // cleanup previous login from login page
            ILoginForm loginForm = pluginManager.FindWindow <ILoginForm>();

            if (loginForm != null)
            {
                loginForm.ResetFields();
            }

            // show login page
            PrepareLoginForm(pluginManager);
        }
Exemplo n.º 2
0
        /////////////////////////////////////////////////////////////////////////////////

        #region Logout Actions
        /////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Performs the logout action for the current user
        /// </summary>
        /// <param name="pluginManager"></param>
        /// <param name="user"></param>
        public static void LogoutUser(IPluginManager pluginManager, UserClient user)
        {
            System.Threading.Thread th = new System.Threading.Thread(
                new System.Threading.ThreadStart(delegate { DoLogout(user); })
            );
            th.Start();

            // change the buttons 
            pluginManager.DisplayLoggedOutButtons();

            // clean up previous search contents (privacy concern)
            ISearchSnippetForm searchForm = pluginManager.FindWindow<ISearchSnippetForm>();
            if (searchForm != null)
                searchForm.DisplayCleanForm();

            // clean up previous publish info
            IPublishSnippetForm publishForm = pluginManager.FindWindow<IPublishSnippetForm>();
            if (publishForm != null)
                publishForm.ResetResults();

            // close publish window
            pluginManager.ClosePublishSnippetWindow();

            // close addSnippet Window
            pluginManager.CloseAddSnippetWindow();

            // cleanup previous login from login page
            ILoginForm loginForm = pluginManager.FindWindow<ILoginForm>();
            if (loginForm != null)
                loginForm.ResetFields();

            // show login page 
            PrepareLoginForm(pluginManager);
        }
Exemplo n.º 3
0
        /////////////////////////////////////////////////////////////////////////////////

        #region About Form
        /////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Closes the obsolete forms when the server is changed in the About form
        /// </summary>
        /// <param name="pluginManager"></param>
        public static void CloseObsoleteFormsFromAbout(IPluginManager pluginManager)
        {
            SearchPageCleanup(pluginManager);
            pluginManager.ClosePublishSnippetWindow();
            pluginManager.CloseAddSnippetWindow();
        }
Exemplo n.º 4
0
        /////////////////////////////////////////////////////////////////////////////////

        #region About Form
        /////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Closes the obsolete forms when the server is changed in the About form
        /// </summary>
        /// <param name="pluginManager"></param>
        public static void CloseObsoleteFormsFromAbout(IPluginManager pluginManager)
        {
            SearchPageCleanup(pluginManager);
            pluginManager.ClosePublishSnippetWindow();
            pluginManager.CloseAddSnippetWindow();
        }