public SystemInfo() { IsAVDetected = TryDetectAV(); DetectDirectXVersion(); PollNetwork(); _networkPollTimer = new TimerWithoutOverlap(networkPollIntervalMs, PollNetwork); }
protected override void SetImage(string url, ImageSource image) { if (!string.IsNullOrWhiteSpace(url) && url.Contains(".gif")) { _image = image; // Workaround for animated gif issues - using a timer. This does have resizing issues for some gifs var timer = _timer; try { if (timer != null) { timer.Dispose(); } } catch (ObjectDisposedException) {} // 250 would immediately cause the problems again! - So probably quite unstable. 750-1000 seems to work - so far. // TODO: What about async void + await Task.Delay + cancellation token instead of timer? _timer = new TimerWithElapsedCancellation(750, () => { var img = _image; _image = null; Dispatcher.BeginInvoke(new Action(() => TrySetAnimatedSource(image, img)), DispatcherPriority.DataBind); _timer = null; return(false); }); } else { base.SetImage(url, image); } }
public LaunchManager(IContentManager cm, IGameContext gameContext, UserSettings settings, IProcessManager processManager, IGameLauncherFactory gameLaunchFactory, IEventAggregator eventBus, IDialogManager dialogManager) { _contentManager = cm; _gameContext = gameContext; _settings = settings; _processManager = processManager; _gameLaunchFactory = gameLaunchFactory; _eventBus = eventBus; _dialogManager = dialogManager; TryHandleServerAddress(); _listTimer = new TimerWithElapsedCancellation(CheckRunningInterval, CheckRunningTimerElapsed); }