public ViewWindow(InitArgs areaArgs, WindowInitArgs initArgs) { InitializeComponent(); ScreenArea = new ScreenArea(areaArgs); Location = initArgs.WindowLocation; Size = initArgs.WindowSize; elementHost1.Child = ScreenArea; BackColor = Color.Black; elementHost1.Show(); }
private void InitObjects(InitArgs args) { GameTime = new Stopwatch(); ViewUpdateTimer = new System.Windows.Forms.Timer(); ViewUpdateTimer.Tick += ViewUpdateTimer_Tick; ViewUpdateTimer.Interval = 250; ViewUpdateTimer.Start(); GlobalTime = new TimeSpan(); InitViews(args); }
private void InitObjects() { viewInitArgs = new InitArgs(); FontInfo NameFont = new FontInfo(Properties.Settings.Default.NameFont.Name, (int)Properties.Settings.Default.NameFont.Size); FontInfo ScoreFont = new FontInfo(Properties.Settings.Default.ScoreFont.Name, (int)Properties.Settings.Default.ScoreFont.Size); FontInfo TimeFont = new FontInfo(Properties.Settings.Default.TimeFont.Name, (int)Properties.Settings.Default.TimeFont.Size); CustomColorWrapper BacgroundColor = new CustomColorWrapper(Properties.Settings.Default.BackgroundColor.R, Properties.Settings.Default.BackgroundColor.G, Properties.Settings.Default.BackgroundColor.B); CustomColorWrapper TextColor = new CustomColorWrapper(Properties.Settings.Default.TextColor.R, Properties.Settings.Default.TextColor.G, Properties.Settings.Default.TextColor.B); viewInitArgs.NameFont = NameFont; viewInitArgs.TextFont = TimeFont; viewInitArgs.ScoreFont = ScoreFont; viewInitArgs.BackgroundColor = BacgroundColor; viewInitArgs.TextColor = TextColor; windowInit = new WindowInitArgs(); windowInit.WindowLocation = Properties.Settings.Default.Location; windowInit.WindowSize = Properties.Settings.Default.Size; viewWindow = new ViewWindow(viewInitArgs, windowInit); windowSize = Properties.Settings.Default.Size; windowLocation = Properties.Settings.Default.Location; imageArgs = new ImageInitArgs(); homeImg = new Size(0, 0); awayImg = new Size(0, 0); imageArgs.HomeImageSize = homeImg; imageArgs.AwayImageSize = awayImg; imageArgs.HomeImagePath = ""; imageArgs.AwayImagePath = ""; timer.Tick += Timer_Tick; timer.Interval = 500; timer.Start(); if (splitContainer1.Width != 0) { splitContainer1.SplitterDistance = splitContainer1.Width / 2; } homePlayers = new List <PlayerControl>(); awayPlayers = new List <PlayerControl>(); }
public void InitViews(InitArgs args) { Color bgColor = new Color(); bgColor.R = (byte)args.BackgroundColor.Red; bgColor.G = (byte)args.BackgroundColor.Green; bgColor.B = (byte)args.BackgroundColor.Blue; bgColor.A = 255; Color textColor = new Color(); textColor.R = (byte)args.TextColor.Red; textColor.G = (byte)args.TextColor.Green; textColor.B = (byte)args.TextColor.Blue; textColor.A = 255; BackColor = new SolidColorBrush(bgColor); TextColor = new SolidColorBrush(textColor); this.Background = BackColor; goal1.Foreground = TextColor; goal2.Foreground = TextColor; score1Label.Foreground = TextColor; score2Label.Foreground = TextColor; timeLabel.Foreground = TextColor; TimeFont = new FontFamily(args.TextFont.FontName); ScoreFont = new FontFamily(args.ScoreFont.FontName); NameFont = new FontFamily(args.NameFont.FontName); goal1.FontFamily = NameFont; goal2.FontFamily = NameFont; goal1.FontSize = args.NameFont.FontSize; goal2.FontSize = args.NameFont.FontSize; score1Label.FontFamily = ScoreFont; score2Label.FontFamily = ScoreFont; score1Label.FontSize = args.ScoreFont.FontSize; score2Label.FontSize = args.ScoreFont.FontSize; timeLabel.FontFamily = TimeFont; timeLabel.FontSize = args.TextFont.FontSize; }
public ScreenArea(InitArgs initArgs) { InitializeComponent(); InitObjects(initArgs); }