public void BeginRetrying(TimeSpan timeout, TimeSpan waitInterval, Uri mediaSource = null, bool isMediaSourceAdaptive = false) { if (_mediaPlugin == null) { throw new InvalidOperationException( SilverlightMediaFrameworkResources.RetryMonitorMediaPluginCannotBeNullMessage); } CancelRetrying(); IsRetrying = true; exitOnFail = false; RegisterMediaPlugin(); _mediaSource = mediaSource; _isMediaSourceAdaptive = isMediaSourceAdaptive; _waitTimer.Interval = waitInterval; SetMediaSource(); _giveupTimer.Interval = timeout; _giveupTimer.Start(); RetryStarted.IfNotNull(i => i(this)); }
protected void OnRetryStarted(object sender, FileCopyRetryStartedEventArgs args) { RetryStarted?.Invoke(sender, args); }