private void TextMessageRecieved(VirusPlayer player, string text) { Dispatcher.Invoke(() => { InTextBox.Text += player.Name + ":\n" + text + "\n"; TextScrollViewer.ScrollToBottom(); }); }
private void PlayerConnected(VirusPlayer player) { Dispatcher.Invoke(() => { InTextBox.Text += "Player " + player.Name + " connected with color " + player.Color.Name + "\n"; TextScrollViewer.ScrollToBottom(); }); }
void BadMessage(string text) { Dispatcher.Invoke(() => { InTextBox.Text += text + "\n"; TextScrollViewer.ScrollToBottom(); }); }
private async Task LoadCurrent() { if (!IsLoading) { IsLoading = true; _tempIndexOfNumberChapterInPage = await _truyen.LoadChapterWithNoiDung(CurrentChapter.PageOfChapter, _tempIndexOfNumberChapterInPage); CacheNextChapter = _truyen.GetChapterByIndex(_tempIndexOfNumberChapterInPage); if (CacheNextChapter != null) { CurrentChapter = CacheNextChapter; if (TextScrollViewer != null) { TextScrollViewer.ChangeView(0, 0, null, true); } _tempIndexOfNumberChapterInPage = _currentIndexOfNumberChapter; } else { if (_truyen.Site != SiteTruyen.LuongSonBac) { if (_tempIndexOfNumberChapterInPage <= 0) { _tempIndexOfNumberChapterInPage = 1; } if (_tempIndexOfNumberChapterInPage > 0) { _tempIndexOfNumberChapterInPage -= 1; } } _dialogService.ShowS("K0 tìm thấy chương sau đó", "Lỗi"); } IsLoading = false; } }
private void PlayerDisconnected(VirusPlayer player) { Dispatcher.Invoke(() => { InTextBox.Text += "Player " + player.Name + " disconnected\n"; TextScrollViewer.ScrollToBottom(); EndGame(); }); }
private void ColorUpdated(VirusPlayer player, System.Drawing.Color orig) { Dispatcher.Invoke(() => { InTextBox.Text += "Player " + player.Name + " changed color to " + player.Color.Name + "\n"; TextScrollViewer.ScrollToBottom(); viruscontrol.Refresh(); }); }
private void NameUpdated(VirusPlayer player, string orig) { Dispatcher.Invoke(() => { InTextBox.Text += "Player " + orig + " changed name to " + player.Name + "\n"; viruscontrol.Refresh(); TextScrollViewer.ScrollToBottom(); }); }
public void ViewModel_SetScale(float scale) { TextScrollViewer.ChangeView(0.0, 0.0, ViewModel.ScaleValue); }