static void RunOverlayToTableAttacher() { var pokerTable = new Window { Title = "The PokerTable" }; var overlayWindowManager = new WindowManager(() => new Window { AllowsTransparency = true, Background = new SolidColorBrush { Color = Colors.Transparent }, WindowStyle = WindowStyle.None, ShowInTaskbar = false, Content = new Button { Content = "OverlayWindow", Margin = new Thickness(50) } }); var watchTableTimer = new DispatcherTimerAdapter { Interval = TimeSpan.FromMilliseconds(100) }; var waitThenTryToFindTableAgainTimer = new DispatcherTimerAdapter { Interval = TimeSpan.FromMilliseconds(3000) }; var attacher = AutoWirerForTableAttacher .ConfigureTableAttacherDependencies() .Resolve <IOverlayToTableAttacher>(); attacher.TableClosed += attacher.Dispose; pokerTable.Show(); overlayWindowManager.Show(); var pokerRoomInfo_Stub = new Mock <IPokerRoomInfo>(); pokerRoomInfo_Stub .SetupGet(i => i.ProcessName).Returns(string.Empty); pokerRoomInfo_Stub .Setup(i => i.TableNameFoundInPokerTableTitleFrom(pokerTable.Title)).Returns(pokerTable.Title); attacher .InitializeWith(overlayWindowManager, watchTableTimer, waitThenTryToFindTableAgainTimer, pokerRoomInfo_Stub.Object, pokerTable.Title) .Activate(); }
public ITableOverlayManager InitializeWith( IGameHistoryViewModel gameHistory, IPokerTableStatisticsViewModel pokerTableStatistics, int showHoleCardsDuration, IConvertedPokerHand firstHand) { HeroName = firstHand.HeroName; _seatMapper.InitializeWith(firstHand.TotalSeats); ITableOverlaySettingsViewModel overlaySettings = SetupOverlaySettings(firstHand); _tableOverlay.InitializeWith(_seatMapper, overlaySettings, gameHistory, pokerTableStatistics, firstHand.HeroName, showHoleCardsDuration); _tableOverlayWindow.DataContext = _tableOverlay; _tableOverlayWindow.Show(); var watchTableTimer = new DispatcherTimerAdapter { Interval = TimeSpan.FromMilliseconds(100) }; var waitThenTryToFindTableAgainTimer = new DispatcherTimerAdapter { Interval = TimeSpan.FromMilliseconds(3000) }; _overlayToTableAttacher.InitializeWith(_tableOverlayWindow, watchTableTimer, waitThenTryToFindTableAgainTimer, _pokerRoomInfoLocator.GetPokerRoomInfoFor(firstHand.Site), firstHand.TableName) .Activate(); UpdateTableOverlay(firstHand); UpdateSeatMapper(firstHand); UpdateOverlayToTableAttacher(firstHand); RegisterEvents(); return(this); }