private void button_SaveList_Click(object sender, EventArgs e)
        {
            // Check if User list contains atleast 1 protocol (otherwise don't exit screen)
            bool validUser = myUserProtocols.Count > 0;

            if (validUser)
            {
                // save list
                saveUserList();

                // close protocol list and user protocol list
                RoboSep_Protocols.getInstance().UserName = strUserName;
                RoboSep_UserConsole.getInstance().Controls.Add(RoboSep_Protocols.getInstance());
                RoboSep_UserConsole.getInstance().Controls.Remove(this);

                // Update user list
                RoboSep_Protocols.getInstance().LoadUsers();

                // LOG
                string logMSG = "Save List button clicked";
                //GUI_Controls.uiLog.LOG(this, "button_SaveList_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);
                //  (logMSG);
                LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            }
            else
            {
                GUI_Controls.RoboMessagePanel prompt = new GUI_Controls.RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING,
                                                                                         LanguageINI.GetString("msgValidUser"), LanguageINI.GetString("headerValidUser"), LanguageINI.GetString("Ok"));
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                prompt.Dispose();
                RoboSep_UserConsole.hideOverlay();
            }
        }
        private void HandleUserProtocolsReloadedBeforeExiting(object sender, EventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("--------- RoboSep_UserSelect: HandleUserProtocolsReloadedBeforeExiting is called. ThreadID = {0}, ----------", Thread.CurrentThread.ManagedThreadId));

            RoboSep_UserConsole.getInstance().NotifyUserSeparationProtocolsUpdated -= evhHandleUserProtocolsReloaded;

            RoboSep_Protocols.getInstance().setProtocolLoading(false);

            // open run samples window
            RoboSep_UserConsole myUC = RoboSep_UserConsole.getInstance();

            RoboSep_UserConsole.ctrlCurrentUserControl = RoboSep_RunSamples.getInstance();
            RoboSep_RunSamples.getInstance().UserName = SelectedUser;
            RoboSep_RunSamples.getInstance().Enabled  = false;
            myUC.SuspendLayout();
            myUC.Controls.Remove(this);
            myUC.Controls.Add(RoboSep_RunSamples.getInstance());
            myUC.ResumeLayout();
            if (RoboSep_RunSamples.getInstance().IsInitialized)
            {
                RoboSep_RunSamples.getInstance().ReInitialize();
            }
            RoboSep_RunSamples.getInstance().Enabled = true;
        }
        private void SelectUser(string UserLogin)
        {
            if (string.IsNullOrEmpty(UserLogin))
            {
                return;
            }

            string usrName = UserLogin;

            RoboSep_UserConsole.strCurrentUser = usrName;

#if false
            // load user preferences
            RoboSep_UserDB.getInstance().loadCurrentUserPreferences(usrName);

            // load user protocols
            List <RoboSep_Protocol> tempList = RoboSep_UserDB.getInstance().loadUserProtocols(usrName);

            // it could be new user with no protocols
            if (tempList != null && tempList.Count > 0)
            {
                // load user protocols
                RoboSep_Protocols.getInstance().LoadUserToServer(usrName);
                RoboSep_Protocols.getInstance().setProtocolLoading(true);
                SeparatorGateway.GetInstance().separatorUpdating = true;

                if (evhHandleUserProtocolsReloaded == null)
                {
                    evhHandleUserProtocolsReloaded = new EventHandler(HandleUserProtocolsReloadedBeforeExiting);
                }

                RoboSep_UserConsole.getInstance().NotifyUserSeparationProtocolsUpdated += evhHandleUserProtocolsReloaded;
                return;
            }
#else
            // load user protocols
            List <RoboSep_Protocol> tempList = RoboSep_UserDB.getInstance().loadUserProtocols(usrName);

            // it could be new user with no protocols
            if (tempList != null && tempList.Count > 0)
            {
                // load user protocols
                RoboSep_Protocols.getInstance().LoadUserToServer(usrName);
                RoboSep_Protocols.getInstance().setProtocolLoading(true);
                SeparatorGateway.GetInstance().separatorUpdating = true;

                // load user preferences
                RoboSep_UserDB.getInstance().loadCurrentUserPreferences(usrName);

                if (evhHandleUserProtocolsReloaded == null)
                {
                    evhHandleUserProtocolsReloaded = new EventHandler(HandleUserProtocolsReloadedBeforeExiting);
                }

                RoboSep_UserConsole.getInstance().NotifyUserSeparationProtocolsUpdated += evhHandleUserProtocolsReloaded;
                return;
            }
            else
            {
                // load user preferences
                RoboSep_UserDB.getInstance().loadCurrentUserPreferences(usrName);
            }
#endif
            // open run samples window
            RoboSep_UserConsole myUC = RoboSep_UserConsole.getInstance();
            RoboSep_UserConsole.ctrlCurrentUserControl = RoboSep_RunSamples.getInstance();
            RoboSep_RunSamples.getInstance().UserName = usrName;
            RoboSep_RunSamples.getInstance().Enabled  = false;
            myUC.SuspendLayout();
            myUC.Controls.Remove(this);
            myUC.Controls.Add(RoboSep_RunSamples.getInstance());
            myUC.ResumeLayout();
            if (RoboSep_RunSamples.getInstance().IsInitialized)
            {
                RoboSep_RunSamples.getInstance().ReInitialize();
            }
            RoboSep_RunSamples.getInstance().Enabled = true;
        }