private void ChangeSettings() { if (streaming != null) { streaming.Stop(); } if (homeStreaming != null) { homeStreaming.Stop(); } hostName = Properties.Settings.Default.HostName; mail = Properties.Settings.Default.UserID; pass = Properties.Settings.Default.UserPass; TimeLineView.DefaultCellStyle.Font = Properties.Settings.Default.FontSetting; TimeLineView.DefaultCellStyle.ForeColor = Properties.Settings.Default.FontColorSetting; InputBox.Font = Properties.Settings.Default.FontSetting; InputBox.ForeColor = Properties.Settings.Default.FontColorSetting; this.BackColor = Properties.Settings.Default.BackColorSetting; TimeLineView.BackgroundColor = Properties.Settings.Default.BackColorSetting; TimeLineView.DefaultCellStyle.BackColor = Properties.Settings.Default.BackColorSetting; TimeLineView.DefaultCellStyle.SelectionBackColor = Properties.Settings.Default.BackColorSetting; TimeLineView.DefaultCellStyle.SelectionForeColor = Properties.Settings.Default.FontColorSetting; InputBox.BackColor = Properties.Settings.Default.BackColorSetting; InputBox.Focus(); Run(); }
public void Stop() { if (UserStreaming != null) { UserStreaming.Stop(); } }
public async Task End(bool success) { if (!IsRunning) { return; } IsRunning = false; if (success) { await MastodonClient.PostStatus(Account.Dead, Visibility.Public); var record = new Record(); await record.InitializeAsync(); await record.PostResultAsync(Account, Results); } else { string option; int random = new Random().Next(5); switch (random) { case 0: option = "壁に穴を開けて"; break; case 1: option = "食料を奪って"; break; default: option = ""; break; } string message = $"({Account.Name}は{option}去って行った...)"; await MastodonClient.PostStatus(message, Visibility.Public); } if (UserStreaming != null) { UserStreaming.Stop(); } }
/// <summary> /// ストリーミングを終了します。 /// </summary> public void Stop() { streaming.Stop(); }