示例#1
0
文件: Util.cs 项目: mark10als/Tvmaid
 public static void SetSleepStop(bool stop)
 {
     lock (lockObj)
     {
         if (stop)
         {
             sleepStopCount++;
             if (sleepStopCount == 1)
             {
                 //Log.Write("スリープ抑止をセット");
                 SleepState.SetState(true);
             }
         }
         else
         {
             sleepStopCount--;
             if (sleepStopCount == 0)
             {
                 SleepState.SetState(false);
                 //Log.Write("スリープ抑止を解除");
             }
         }
     }
 }
示例#2
0
        public static void Stop(bool flug)
        {
            object obj = SleepState.lockObj;

            lock (obj)
            {
                if (flug)
                {
                    SleepState.count++;
                    if (SleepState.count == 1)
                    {
                        SleepState.SetState(true);
                    }
                }
                else
                {
                    SleepState.count--;
                    if (SleepState.count == 0)
                    {
                        SleepState.SetState(false);
                    }
                }
            }
        }