public Console() { InitializeComponent(); (newConsole.Content as Image).Source = App.MakeDarkTheme((newConsole.Content as Image).Source as BitmapSource); ActiveConsoles.Add(this); inputTB.IsEnabled = ConsolesUnlocked; outputTB.Document.Blocks.Clear(); outputTB.Document.Blocks.Add(MainParagraph = new Paragraph()); if (ConsolesUnlocked) { upperSeparator.Background = new SolidColorBrush(Colors.DodgerBlue); lowerSeparator.Background = new SolidColorBrush(Colors.DodgerBlue); inputSign.Foreground = new SolidColorBrush(Colors.DodgerBlue); } else { upperSeparator.Background = new SolidColorBrush(Colors.Gray); lowerSeparator.Background = new SolidColorBrush(Colors.Gray); inputSign.Foreground = new SolidColorBrush(Colors.White); } }
public void Deserialize(IMessageReader reader, bool initialState) { Countdown = reader.ReadSingle(); Timer = reader.ReadSingle(); ActiveConsoles.Clear(); // TODO: Thread safety CompletedConsoles.Clear(); // TODO: Thread safety uint activeCount = reader.ReadPackedUInt32(); for (int i = 0; i < activeCount; i++) { ActiveConsoles.Add(new Tuple <byte, byte>(reader.ReadByte(), reader.ReadByte())); } uint completedCount = reader.ReadPackedUInt32(); for (int i = 0; i < completedCount; i++) { CompletedConsoles.Add(reader.ReadByte()); } }