コード例 #1
0
    private void SetPauseState(bool focus, bool pause)
    {
        if (focus && !pause)
        {
            //唤醒
            BeSleep = false;
            if (BeShowLog)
            {
                Debug.Log("[nafio-net]--->唤醒");
            }


            ResumeEvent?.Invoke();
        }

        if (!focus && pause)
        {
            if (BeShowLog)
            {
                Debug.Log("[nafio-net]--->睡眠");
            }

            //睡
            BeSleep = true;
            SleepEvent?.Invoke();
        }
    }
コード例 #2
0
 /// <summary>
 /// 恢复按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void resume_Click(object sender, EventArgs e)
 {
     if (running)     //运行中
     {
         if (pausing) //暂停中
         {
             ResumeEvent?.Invoke();
             pausing       = false;
             pause.Enabled = true;
         }
         else
         {
             return;
         }
     }
     else
     {
         return;
     }
 }
コード例 #3
0
 protected virtual void OnResumeEvent(EventArgs args)
 {
     ResumeEvent?.Invoke(this, args);
 }