private void RoboSep_UserProtocolList_Load(object sender, EventArgs e)
        {
            // set my protocolList to protocol list created by protocols window
            myProtocolList = RoboSep_ProtocolList.getInstance();

            // load user name from UserConsole window
            UserNameHeader.Text = strUserName;

            // set labels and button text based on language settings
            LanguageINI = RoboSep_UserConsole.getInstance().LanguageINI;
            //lblUsrProtocols.Text = LanguageINI.GetString("lblUserProtocols");
            TabLists.Tab1        = LanguageINI.GetString("lblEditList");
            TabLists.Tab2        = LanguageINI.GetString("lblMyList");
            button_Remove.Text   = LanguageINI.GetString("lblRemoveProtocol");
            button_SaveList.Text = LanguageINI.GetString("lblSaveList");

            // set up for drawing
            theFormat               = new StringFormat();
            theFormat.Alignment     = StringAlignment.Near;
            theFormat.LineAlignment = StringAlignment.Center;
            BG_ColorEven            = Color.FromArgb(216, 217, 218);
            BG_ColorOdd             = Color.FromArgb(243, 243, 243);
            BG_Selected             = Color.FromArgb(78, 38, 131);
            Txt_Color               = Color.FromArgb(95, 96, 98);
        }
        private void button_AllProtocols_Click(object sender, EventArgs e)
        {
            // switch to all protocols control
            RoboSep_UserConsole.getInstance().Controls.Remove(this);
            RoboSep_UserConsole.getInstance().Controls.Add(RoboSep_ProtocolList.getInstance());

            // LOG
            string logMSG = "All Protocols button clicked";

            //GUI_Controls.uiLog.LOG(this, "button_AllProtocols_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);
            //  (logMSG);
            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
Example #3
0
        private void hex_protocols_Click(object sender, EventArgs e)
        {
            // check if any protocols are selected
            int[] CurrentQuadrants = RoboSep_RunSamples.getInstance().iSelectedProtocols;
            if (CurrentQuadrants.Length > 0)
            {
                // prompt if user is sure they want to manage protocols if all protocol selections are removed
                string           msg    = LanguageINI.GetString("msgManageProtocols");
                RoboMessagePanel prompt = new RoboMessagePanel(RoboSep_UserConsole.getInstance(), MessageIcon.MBICON_WARNING, msg,
                                                               LanguageINI.GetString("headerManageProtocols"), LanguageINI.GetString("Ok"), LanguageINI.GetString("Cancel"));
                RoboSep_UserConsole.showOverlay();
                prompt.ShowDialog();
                RoboSep_UserConsole.hideOverlay();

                if (prompt.DialogResult != DialogResult.OK)
                {
                    prompt.Dispose();
                    return;
                }
                prompt.Dispose();
            }

            // remove all currently selected protocols
            for (int i = 0; i < CurrentQuadrants.Length; i++)
            {
                RoboSep_RunSamples.getInstance().CancelQuadrant(CurrentQuadrants[i]);
            }

            RoboSep_UserConsole.getInstance().SuspendLayout();
            RoboSep_ProtocolList myProtocolsListPage = RoboSep_ProtocolList.getInstance();

            if (myProtocolsListPage.IsInitialized)
            {
                myProtocolsListPage.ReInitialized();
            }

            myProtocolsListPage.Location    = new Point(0, 0);
            myProtocolsListPage.strUserName = RoboSep_UserConsole.strCurrentUser;
            RoboSep_UserConsole.getInstance().Controls.Add(myProtocolsListPage);
            RoboSep_UserConsole.ctrlCurrentUserControl = myProtocolsListPage;

            closeHomeWindow();

            myProtocolsListPage.BringToFront();
            // LOG
            string logMSG = "Protocols button clicked";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
        }
        private void openProtocolList()
        {
            // create user protocol list window
            myUserProtocolList             = RoboSep_UserProtocolList.getInstance();
            myUserProtocolList.strUserName = textBox_UserName.Text;

            // create all protocols list window
            myProtocolList             = RoboSep_ProtocolList.getInstance();
            myProtocolList.strUserName = textBox_UserName.Text;

            // show protocol list
            myProtocolList.Visible = false;

            // reset protocol list form and user protocol list
            //     myProtocolList.resetForm();

            // show protocol list control
            RoboSep_UserConsole.getInstance().Controls.Add(myProtocolList);
            RoboSep_UserConsole.getInstance().Controls.Remove(this);
            myProtocolList.Visible = true;
        }
 private void button_Remove_Click(object sender, EventArgs e)
 {
     // remove selected item from userProtoclList
     for (int i = 0; i < lvUserProtocols.SelectedItems.Count; i++)
     {
         for (int j = 0; j < myUserProtocols.Count; j++)
         {
             if (lvUserProtocols.SelectedItems[i].Text == myUserProtocols[j].Protocol_Name)
             {
                 // LOG
                 string logMSG = "Removing protocol '" + myUserProtocols[j].Protocol_Name + "' from user list";
                 //GUI_Controls.uiLog.LOG(this, "button_Remove_Click", GUI_Controls.uiLog.LogLevel.EVENTS, logMSG);
                 //  (logMSG);
                 LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
                 myUserProtocols.RemoveAt(j);
                 break;
             }
         }
     }
     refreshList();
     RoboSep_ProtocolList.getInstance().refreshList();
 }
        private void removeProtocol(int visibleListRef)
        {
            int topItemIndex = FindTopListItemIndex();

            if (topItemIndex >= 0)
            {
                string removeItem = lvUserProtocols.Items[topItemIndex + visibleListRef].Text;
                // look for item in user list
                for (int i = 0; i < myUserProtocols.Count; i++)
                {
                    if (myUserProtocols[i].Protocol_Name == removeItem)
                    {
                        myUserProtocols.RemoveAt(i);
                        RoboSep_ProtocolList.getInstance().refreshList();
                        break;
                    }
                }
                lvUserProtocols.Items.RemoveAt(topItemIndex + visibleListRef);
                if (lvUserProtocols.Items.Count == ITEMS_ON_SCREEN - 1)
                {
                    refreshList();
                }
            }
        }