Пример #1
0
        private void Initialize()
        {
            LoadUserPreferences(userName);
//            RoboSep_UserConsole.hideOverlay();  //CWJ TOOKOUT
            if (loading != null)
            {
                loading.Close();
                loading = null;
            }

            RefreshPreferencesDisplayList(dictUserPreferencesFromConfig);
            listView_UserPref.ResizeVerticalHeight(true);

            this.scrollIndicator1.LargeChange = listView_UserPref.VisibleRow - 1;
            this.scrollIndicator1.Maximum     = listView_UserPref.Items.Count;
            listView_UserPref.VScrollbar      = this.scrollIndicator1;

            Rectangle rcScrollbar = this.scrollIndicator1.Bounds;

            this.scrollIndicator1.SetBounds(rcScrollbar.X, listView_UserPref.Bounds.Y, rcScrollbar.Width, listView_UserPref.Bounds.Height);
            listView_UserPref.UpdateScrollbar();

            SetUpScrollIndicatorThumbs();

            rcScrollIndicator            = scrollIndicator1.Bounds;
            rcListViewUserPreferences    = listView_UserPref.Bounds;
            SpacingBetweenLVAndIndicator = rcScrollIndicator.X - (rcListViewUserPreferences.X + rcListViewUserPreferences.Width);
            ListViewColumn1Width         = listView_UserPref.Columns[0].Width;

            UpdateScrollIndicatorVisibility();
        }
        public void StartLoadingProtocolsToServer(string ActiveUser, List <RoboSep_Protocol> tempList)
        {
            if (tempList == null)
            {
                return;
            }

            // LOG
            string logMSG = "Start thread for loading profile";

            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG);
            try
            {
                RoboSep_UserConsole.strCurrentUser = ActiveUser;// textBox_UserName.Text;
                UserNameHeader.Text = ActiveUser;

                string[] sProtocols = new string[tempList.Count];
                for (int i = 0; i < tempList.Count; i++)
                {
                    sProtocols[i] = tempList[i].Protocol_FileName;
                }

                // save over user1.udb
                RoboSep_UserDB.getInstance().XML_SaveUserProfile(ActiveUser, sProtocols);
                protocolsToLoad = sProtocols.Length;

                // Reload protocols with SeparatorGateway using a thread
                myReloadProtocolsThread = new Thread(new ThreadStart(this.ReloadProtocolsThread));
                myReloadProtocolsThread.IsBackground = true;
                myReloadProtocolsThread.Start();

                // set sep-gateway to updating Separator Protocols
                // so that we can watch for when it is updated
                // (in timer_tick)
                SeparatorGateway.GetInstance().separatorUpdating = true;

                string sMSG   = LanguageINI.GetString("msgLoadingProtocols");
                string sTitle = LanguageINI.GetString("headerLoadingUserProtocols");
                loading = new RoboMessagePanel5(RoboSep_UserConsole.getInstance(), sTitle, sMSG, GUI_Controls.GifAnimationMode.eUploadingMultipleFiles);
                RoboSep_UserConsole.showOverlay();
                loading.Show();
                //Thread.Sleep(SERVER_WAIT_TIME);
                // add loop to that polls loading status
                LoadUserTimer.Start();
            }
            catch (Exception ex)
            {
                // LOG
                logMSG = "Failed to save user to server";

                LogFile.AddMessage(System.Diagnostics.TraceLevel.Error, logMSG);
            }
        }
Пример #3
0
        private void RoboSep_UserPreferences_Load(object sender, EventArgs e)
        {
            if (dictUserPreferencesFromConfig == null)
            {
                dictUserPreferencesFromConfig = new Dictionary <string, PreferenceSettings>();
            }
            if (dictDevicePreferencesFromConfig == null)
            {
                dictDevicePreferencesFromConfig = new Dictionary <string, PreferenceSettings>();
            }
            syncobj = new object();
            Bitmap b1 = new Bitmap(Properties.Resources.GE_BTN08S_unselect_STD);
            Bitmap b2 = new Bitmap(Properties.Resources.GE_BTN07S_select_CLICK);
            Bitmap b3 = new Bitmap(Properties.Resources.PF_BTN01S_details_STD);

            this.imageList1.ColorDepth = ColorDepth.Depth32Bit;
            this.imageList1.ImageSize  = new Size(40, 40); // this will affect the row height
            this.imageList1.Images.Add("unchecked", b1);
            this.imageList1.Images.Add("checked", b2);
            this.imageList1.Images.Add("help", b3);
            listView_UserPref.SmallImageList = this.imageList1;

            UserNameHeader.Text = userName;

            // 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);

            // show loading protocol message
            string title = LanguageINI.GetString("headerLoadingUserPreferences");
            string msg   = LanguageINI.GetString("msgLoadingUserPreferences");

            loading = new RoboMessagePanel5(RoboSep_UserConsole.getInstance(), title, msg, GUI_Controls.GifAnimationMode.eUploadingMultipleFiles);
//            RoboSep_UserConsole.showOverlay();  //CWJ TOOKOUT
            loading.Show();
            button_Cancel.Enabled = false;
            button_Save.Enabled   = false;
            timer1.Start();

            b1.Dispose();
            b2.Dispose();
            b3.Dispose();
            this.Focus();
        }