Business.ProcessWatcher.EnsureRunning C# (CSharp) Метод

EnsureRunning() публичный Метод

public EnsureRunning ( ) : void
Результат void
        public void EnsureRunning() {
            if (!timerKillIfFrozen.Enabled)
                timerKillIfFrozen.Start();

            if ((api.MpcProcess == null || api.MpcProcess.HasExited) && runAttemps < 3) {
                runAttemps++;
                timerKillIfFrozen.Interval = 3000 + 3000 * runAttemps;
                api.Run();
            }
        }
    }

Usage Example

Пример #1
0
        public async Task PlayVideoAsync(Media video, bool enableAutoPitch)
        {
            CurrentVideo            = video;
            IsAutoPitchEnabled      = enableAutoPitch;
            customFileName          = null;
            TimerGetPositionEnabled = false;
            position        = 0;
            restorePosition = 0;
            nowPlayingPath  = null;
            lastStartTime   = DateTime.Now;
            watcher.EnsureRunning();
            await apiAccess.OpenFileAsync(MediaFileName);

            // If video doesn't load after 5 seconds, send the play command again.
            timerPlayTimeout.Stop();
            timerPlayTimeout.Start();
        }