예제 #1
0
        public PictureBoxObj(long clientID, long pictubeBoxID, PictureBoxStatus status)
        {
            this.DoubleBuffered = true;
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.ResizeRedraw | ControlStyles.ContainerControl |
                          ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);

            _uniqueID = pictubeBoxID;
            _clientID = clientID;

            _status = status;
        }
예제 #2
0
        private void SetPictureBoxStatus(PictureBox pictureBox, PictureBoxStatus newStatus)
        {
            try
            {
                Image[] map = new Image[] { Pg3bWindowsFormsApplication.Properties.Resources.GreyDot,
                                            Pg3bWindowsFormsApplication.Properties.Resources.GreenDot,
                                            Pg3bWindowsFormsApplication.Properties.Resources.RedDot };

                PictureBoxStatus oldStatus = (PictureBoxStatus)pictureBox.Tag;
                if (newStatus > oldStatus)
                {
                    pictureBox.Tag   = newStatus;
                    pictureBox.Image = map[(int)newStatus];
                }
            }
            catch
            {
                pictureBox.Image = Pg3bWindowsFormsApplication.Properties.Resources.GreyDot;
                pictureBox.Tag   = PictureBoxStatus.Unknown;
            }
        }
예제 #3
0
 private void SetPicBoxStatusAsync(PictureBoxStatus.PicBoxStatus picBox, PictureBoxStatus.ImageState state)
 {
     if (picBox.InvokeRequired) { picBox.Invoke(new Action(delegate { picBox.CurrentStatus = state; })); }
     else { picBox.CurrentStatus = state; }
 }
예제 #4
0
        private void SetPictureBoxStatus(PictureBox pictureBox, PictureBoxStatus newStatus)
        {
            try
            {
                Image[] map = new Image[] { Pg3bWindowsFormsApplication.Properties.Resources.GreyDot,
                                            Pg3bWindowsFormsApplication.Properties.Resources.GreenDot,
                                            Pg3bWindowsFormsApplication.Properties.Resources.RedDot };

                PictureBoxStatus oldStatus = (PictureBoxStatus)pictureBox.Tag;
                if (newStatus > oldStatus)
                {
                    pictureBox.Tag = newStatus;
                    pictureBox.Image = map[(int)newStatus];
                }
            }
            catch
            {
                pictureBox.Image = Pg3bWindowsFormsApplication.Properties.Resources.GreyDot;
                pictureBox.Tag = PictureBoxStatus.Unknown;
            }
        }