コード例 #1
0
ファイル: Model.cs プロジェクト: mohemohe/FFXIVRamWatch
        public Model()
        {
            checkFfxiv = new CheckFFXIV();
            _se        = new SE.SE();

            var listener = new PropertyChangedEventListener(checkFfxiv);

            listener.RegisterHandler(UpdateHandlerProxy);

            _timer          = new Timer();
            _timer.Elapsed += (sender, args) => checkFfxiv.Check();
            _timer.Interval = Config.Wait;
        }
コード例 #2
0
ファイル: Model.cs プロジェクト: mohemohe/FFXIVRamWatch
 private async void PlaySE(CheckFFXIV ffxivInfo)
 {
     if (ffxivInfo.PrivateBytesInfomation.Bytes >= Config.HighThreshold ||
         ffxivInfo.VirtualBytesInfomation.Bytes >= Config.HighThreshold)
     {
         if (Config.SE.HighThreshold.Play)
         {
             try
             {
                 await _se.PlaySeAsync(Config.SE.HighThreshold.SoundFile);
             }
             catch
             {
             }
         }
     }
     else if (ffxivInfo.PrivateBytesInfomation.Bytes >= Config.LowThreshold ||
              ffxivInfo.VirtualBytesInfomation.Bytes >= Config.LowThreshold)
     {
         if (Config.SE.LowThreshold.Play)
         {
             try
             {
                 await _se.PlaySeAsync(Config.SE.LowThreshold.SoundFile);
             }
             catch
             {
             }
         }
         else
         {
             _se.SetSE(Config.SE.LowThreshold.SoundFile);
         }
     }
     else
     {
         _se.ResetSE();
     }
 }