Esempio n. 1
0
        public bool DoIdle(object sender)
        {
            System.Threading.Thread.Sleep(1);   // 避免CPU资源过度耗费

            bool bDoEvents = true;

            if (this.Idle != null)
            {
                DtlpIdleEventArgs e = new DtlpIdleEventArgs();
                this.Idle(sender, e);
                if (e.Stop == true)
                {
                    return(true);
                }
                bDoEvents = e.bDoEvents;
            }

            if (bDoEvents == true)
            {
                try
                {
                    Application.DoEvents();     // 出让界面控制权
                }
                catch
                {
                }
            }

            System.Threading.Thread.Sleep(1);   // 避免CPU资源过度耗费

            return(false);
        }
Esempio n. 2
0
        public bool DoIdle(object sender)
        {
            System.Threading.Thread.Sleep(1);	// 避免CPU资源过度耗费

            bool bDoEvents = true;
            if (this.Idle != null)
            {
                DtlpIdleEventArgs e = new DtlpIdleEventArgs();
                this.Idle(sender, e);
                if (e.Stop == true)
                    return true;
                bDoEvents = e.bDoEvents;
            }

            if (bDoEvents == true)
            {
                try
                {
                    Application.DoEvents();	// 出让界面控制权
                }
                catch
                {
                }
            }

            System.Threading.Thread.Sleep(1);	// 避免CPU资源过度耗费

            return false;
        }
Esempio n. 3
0
 void DtlpChannels_Idle(object sender, DtlpIdleEventArgs e)
 {
     e.bDoEvents = true;
 }
Esempio n. 4
0
 void channelArray_Idle(object sender, DtlpIdleEventArgs e)
 {
     e.bDoEvents = true;
 }