Ejemplo n.º 1
0
        static void All_LensProtection()
        {
            string StartUpType;

            if (tmpLensProtectionBusiness != null)
            {
                tmpLensProtectionBusiness.ThreadStop();
                tmpLensProtectionBusiness = null;
                Thread.Sleep(2000);
                tmpLensProtectionBusiness = new LensProtectionBusiness();
                StartUpType = tmpLensProtectionBusiness.seviceInfo();
                if (StartUpType == "1")
                {
                    tmpLensProtectionBusiness.ThreadOpen();
                }
                else
                {
                    tmpLensProtectionBusiness = null;
                }
            }
            else
            {
                tmpLensProtectionBusiness = new LensProtectionBusiness();
                StartUpType = tmpLensProtectionBusiness.seviceInfo();
                if (StartUpType == "1")
                {
                    tmpLensProtectionBusiness.ThreadOpen();
                }
                else
                {
                    tmpLensProtectionBusiness = null;
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 红外保护
 /// </summary>
 public static void IRProtect()
 {
     if (tmpLensProtectionBusiness == null)
     {
         tmpLensProtectionBusiness = new LensProtectionBusiness();
         tmpLensProtectionBusiness.seviceInfo();
         tmpLensProtectionBusiness.ThreadOpen();
     }
     else
     {
         tmpLensProtectionBusiness.ThreadStop();
         Thread.Sleep(50);
         tmpLensProtectionBusiness = null;
         Thread.Sleep(100);
         tmpLensProtectionBusiness = new LensProtectionBusiness();
         Thread.Sleep(100);
         tmpLensProtectionBusiness.seviceInfo();
         tmpLensProtectionBusiness.ThreadOpen();
     }
 }