public Clock(Canvas sourceCanvas) : base(sourceCanvas) { count.Interval = TimeSpan.FromSeconds(1); count.Tick += Count_Elapsed; count.Start(); Controller.name.Content = "Clock"; GraphicWidth = 200; GraphicHeight = 150; X = 1600; Y = 100; Texts = new GraphicText[1]; Texts[0] = new GraphicText(container) { Name = "Time", Content = DateTime.Now.ToString("HH:mm"), X = 20, Y = 35, FontSize = 60, FontWeight = FontWeights.Bold, Width = 200 }; }
public DoubleText(Canvas sourceCanvas) : base(sourceCanvas) { Controller.name.Content = "DoubleText"; Texts = new GraphicText[2]; GraphicHeight = 150; GraphicWidth = 700; X = 0; Y = 900; Texts[0] = new GraphicText(container); Texts[0].Name = "Text1"; Texts[0].Content = "Example"; Texts[0].X = 50; Texts[0].Y = 15; Texts[0].FontSize = 60; Texts[0].FontWeight = FontWeights.Bold; Texts[0].Width = 600; Texts[1] = new GraphicText(container); Texts[1].Name = "Text2"; Texts[1].Content = "Example"; Texts[1].X = 50; Texts[1].Y = 75; Texts[1].FontSize = 60; Texts[1].FontWeight = FontWeights.Bold; Texts[1].Width = 600; }
private static void ParsePeliliigaGroup(JObject root) { Windows.Main.GroupsUI.title.Text = root["Group"]["name"].ToString(); // Group name ((Group)GraphicController.Selected.Graphic).Texts[0].Content = Windows.Main.GroupsUI.title.Text; JArray items = (JArray)root["GroupResult"]; // Contestants for (int i = 1; i < 6; i++) { TextBox namebox = (TextBox)Windows.Main.GroupsUI.FindName("n" + i.ToString()); TextBox scorebox = (TextBox)Windows.Main.GroupsUI.FindName("s" + i.ToString()); GraphicText name = ((Group)GraphicController.Selected.Graphic).Texts[i]; GraphicText score = ((Group)GraphicController.Selected.Graphic).Texts[i + 5]; if (i < items.Count) // if there is data { namebox.Text = items[i]["Contestant"]["name"].ToString(); // Contestant name scorebox.Text = items[i]["wins"].ToString() + "-" + items[i]["losses"].ToString(); // wins and losses name.Content = namebox.Text; score.Content = scorebox.Text; } else { namebox.Text = string.Empty; scorebox.Text = string.Empty; name.Content = string.Empty; score.Content = string.Empty; } } }
public Group(Canvas sourceCanvas) : base(sourceCanvas) { Controller.name.Content = "Groups"; Texts = new GraphicText[11]; GraphicHeight = 500; GraphicWidth = 800; X = 200; Y = 300; Texts[0] = new GraphicText(container) { Name = "Title", Content = "Title", X = 20, Y = 20, Width = 400, FontSize = 40 }; // Teams for (int i = 1; i < 6; i++) { Texts[i] = new GraphicText(container) { Name = "Team" + i.ToString(), Content = "Team", X = 20, Y = i * 75 + 30, Width = 400, FontSize = 40 }; } // Scores for (int i = 6; i < 11; i++) { Texts[i] = new GraphicText(container) { Name = "Score" + (i - 5).ToString(), Content = "0-0", ContentAlign = HorizontalAlignment.Center, X = 400, Y = (i - 5) * 75 + 30, Width = 75, FontSize = 40 }; } }
public SingleText(Canvas sourceCanvas) : base(sourceCanvas) { Controller.name.Content = "SingleText"; Texts = new GraphicText[1]; GraphicHeight = 150; GraphicWidth = 600; X = 0; Y = 900; Texts[0] = new GraphicText(container) { Name = "Text", Content = "Example", X = 50, Y = 15, FontSize = 60, FontWeight = FontWeights.Bold, Width = 600 }; }
public Countdown(Canvas sourceCanvas) : base(sourceCanvas) { Controller.name.Content = "Countdown"; count.Interval = TimeSpan.FromMilliseconds(200); count.Tick += Count_Elapsed; start = new Button(); start.Content = "Start"; start.HorizontalAlignment = HorizontalAlignment.Right; start.Margin = new Thickness(0, 10, 115, 0); start.VerticalAlignment = VerticalAlignment.Top; start.Width = 80; start.Click += new RoutedEventHandler(Start_Click); Controller.grid.Children.Add(start); reset = new Button(); reset.Content = "Reset"; reset.HorizontalAlignment = HorizontalAlignment.Right; reset.Margin = new Thickness(0, 10, 210, 0); reset.VerticalAlignment = VerticalAlignment.Top; reset.Width = 80; reset.Click += new RoutedEventHandler(Reset_Click); Controller.grid.Children.Add(reset); Texts = new GraphicText[1]; GraphicWidth = 400; GraphicHeight = 150; X = 300; Y = 900; Texts[0] = new GraphicText(container); Texts[0].Name = "Timer"; Texts[0].Content = "00:00:00"; Texts[0].X = 0; Texts[0].Y = 40; Texts[0].FontSize = 60; Texts[0].FontWeight = FontWeights.Bold; Texts[0].Width = 300; }
public Bracket(Canvas sourceCanvas) : base(sourceCanvas) { Controller.name.Content = "Bracket"; Texts = new GraphicText[1]; GraphicWidth = 1920; GraphicHeight = 1080; X = 0; Y = 0; Texts[0] = new GraphicText(container) { Name = "Title", Content = "Title", X = 270, Y = 90, FontWeight = FontWeights.Bold, FontSize = 40, Width = 780 }; for (int i = 0; i < Names.Length; i++) { Names[i] = new GraphicText(container) { Content = "TBD" }; Scores[i] = new GraphicText(container) { Content = "0" }; } Color = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FF7A0606")); ExampleLabel = new GraphicText(container); ExampleLabel.Name = "examplelabel"; ExampleLabel.FontSize = 40; }
public RichText(Canvas sourceCanvas) : base(sourceCanvas) { Controller.name.Content = "RichText"; Texts = new GraphicText[1]; GraphicWidth = 500; GraphicHeight = 600; X = 200; Y = 200; Texts[0] = new GraphicText(container) { Rich = true, Name = "Text", Content = "Example\nExample\nExample\nExample\nExample", X = 32, Y = 10, FontSize = 40, FontWeight = FontWeights.Bold, Width = 450, LineHeight = 50 }; }
public Scoreboard(Canvas sourceCanvas) : base(sourceCanvas) { Controller.name.Content = "Scoreboard"; Texts = new GraphicText[5]; GraphicHeight = 75; GraphicWidth = 1920; X = 0; Y = 0; Texts[0] = new GraphicText(container) { Name = "P1_Name", Content = "Player1", FontWeight = FontWeights.Bold, ContentAlign = HorizontalAlignment.Right, FontSize = 32, Width = 700, X = 0, Y = 10 }; Texts[1] = new GraphicText(container) { Name = "P2_Name", Content = "Player2", FontWeight = FontWeights.Bold, ContentAlign = HorizontalAlignment.Left, FontSize = 32, Width = 600, X = 1200, Y = 10 }; Texts[2] = new GraphicText(container) { Name = "P1_Score", Content = "0", FontWeight = FontWeights.Bold, ContentAlign = HorizontalAlignment.Center, FontSize = 40, Width = 75, X = 765, Y = 10 }; Texts[3] = new GraphicText(container) { Name = "P2_Score", Content = "0", FontWeight = FontWeights.Bold, ContentAlign = HorizontalAlignment.Center, FontSize = 40, Width = 75, X = 1070, Y = 10 }; Texts[4] = new GraphicText(container) { Name = "Info_text", Content = "Info text", FontWeight = FontWeights.Bold, ContentAlign = HorizontalAlignment.Center, FontSize = 32, Width = 1920, X = 0, Y = 10 }; }