Пример #1
0
        public void U_SetState(ConnType connType)
        {
            if (this.InvokeRequired)
            {
                On2Pressed onPressed = new On2Pressed(U_SetState);
                this.Invoke(onPressed, new object[] { connType });
            }
            else
            {
                lock (this)
                {
                    this.U_ImageIndex = (int)connType;

                    //this.pic.Location = new Point((this.Width - this.pic.Width) / 2, (this.Height - this.pic.Height) / 2);

                    this.pic.Refresh();
                }
            }
            //this.pic.Refresh();
        }
Пример #2
0
 public void SetState(ConnType connType)
 {
     if (_state != connType)
     {
         _state = connType;
         if (this.InvokeRequired)
         {
             On2Pressed onPressed = new On2Pressed(setStateInvoke);
             try
             {
                 this.Invoke(onPressed, new object[] { connType });
             }
             catch { }
         }
         else
         {
             setStateInvoke(connType);
         }
     }
     //this.pic.Refresh();
 }
Пример #3
0
        public void SetState(ConnType connType)
        {
            try
            {
                if (_state != connType)
                {
                    if (this.InvokeRequired)
                    {
                        On2Pressed func = setStateNow;
                        this.Invoke(func, connType);
                    }
                    else
                    {
                        setStateNow(connType);
                        //_state = connType;

                        //_isRefresh = true;
                        //_refreshTimer.Start();
                    }
                }
            }
            catch { }
            //this.pic.Refresh();
        }