X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=OpenTween%2FFilterDialog.cs;h=ef373cbb612fcf8782853caa77832842ae5d0377;hb=d28a534bb744c907c77ac0f41f3f3a299e950836;hp=2539fb8644773919c85dd63e14197be03fd07988;hpb=369ec546d7885b9cd22916c5270beca0405c1b60;p=opentween%2Fopen-tween.git diff --git a/OpenTween/FilterDialog.cs b/OpenTween/FilterDialog.cs index 2539fb86..ef373cbb 100644 --- a/OpenTween/FilterDialog.cs +++ b/OpenTween/FilterDialog.cs @@ -6,19 +6,19 @@ // (c) 2010-2011 fantasticswallow (@f_swallow) // (c) 2011-2012 kim_upsilon (@kim_upsilon) // All rights reserved. -// +// // This file is part of OpenTween. -// +// // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by the Free // Software Foundation; either version 3 of the License, or (at your option) // any later version. -// +// // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// +// for more details. +// // You should have received a copy of the GNU General Public License along // with this program. If not, see , or write to // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, @@ -28,16 +28,16 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; using System.Linq; -using System.Text; -using System.Windows.Forms; using System.Linq.Expressions; +using System.Text; using System.Text.RegularExpressions; -using System.IO; -using System.Collections.Specialized; +using System.Windows.Forms; using OpenTween.Models; namespace OpenTween @@ -117,40 +117,46 @@ namespace OpenTween private void SetFilters(TabModel tab) { - if (ListTabs.Items.Count == 0) return; + if (this.ListTabs.Items.Count == 0) return; - ListFilters.Items.Clear(); + this.ListFilters.Items.Clear(); if (tab is FilterTabModel filterTab) - ListFilters.Items.AddRange(filterTab.GetFilters()); + this.ListFilters.Items.AddRange(filterTab.GetFilters()); - if (ListFilters.Items.Count > 0) - ListFilters.SelectedIndex = 0; + if (this.ListFilters.Items.Count > 0) + this.ListFilters.SelectedIndex = 0; else - ShowDetail(); + this.ShowDetail(); if (tab.IsDefaultTabType) { - CheckProtected.Checked = true; - CheckProtected.Enabled = false; + this.CheckProtected.Checked = true; + this.CheckProtected.Enabled = false; } else { - CheckProtected.Checked = tab.Protected; - CheckProtected.Enabled = true; + this.CheckProtected.Checked = tab.Protected; + this.CheckProtected.Enabled = true; } - CheckManageRead.Checked = tab.UnreadManage; - CheckNotifyNew.Checked = tab.Notify; + this.CheckManageRead.CheckedChanged -= this.CheckManageRead_CheckedChanged; + this.CheckManageRead.Checked = tab.UnreadManage; + this.CheckManageRead.CheckedChanged += this.CheckManageRead_CheckedChanged; + + this.CheckNotifyNew.CheckedChanged -= this.CheckNotifyNew_CheckedChanged; + this.CheckNotifyNew.Checked = tab.Notify; + this.CheckNotifyNew.CheckedChanged += this.CheckNotifyNew_CheckedChanged; - var idx = ComboSound.Items.IndexOf(tab.SoundFile); + var idx = this.ComboSound.Items.IndexOf(tab.SoundFile); if (idx == -1) idx = 0; - ComboSound.SelectedIndex = idx; + this.ComboSound.SelectedIndex = idx; - if (_directAdd) return; + if (this._directAdd) return; if (tab.TabType == MyCommon.TabUsageType.Mute) { + this.ButtonRenameTab.Enabled = false; this.CheckManageRead.Enabled = false; this.CheckNotifyNew.Enabled = false; this.ComboSound.Enabled = false; @@ -160,6 +166,7 @@ namespace OpenTween } else { + this.ButtonRenameTab.Enabled = true; this.CheckManageRead.Enabled = true; this.CheckNotifyNew.Enabled = true; this.ComboSound.Enabled = true; @@ -168,45 +175,45 @@ namespace OpenTween this.labelMuteTab.Visible = false; } - ListTabs.Enabled = true; - GroupTab.Enabled = true; - ListFilters.Enabled = true; - EditFilterGroup.Enabled = false; + this.ListTabs.Enabled = true; + this.GroupTab.Enabled = true; + this.ListFilters.Enabled = true; + this.EditFilterGroup.Enabled = false; if (tab.IsDistributableTabType) { - ButtonNew.Enabled = true; - if (ListFilters.SelectedIndex > -1) + this.ButtonNew.Enabled = true; + if (this.ListFilters.SelectedIndex > -1) { - ButtonEdit.Enabled = true; - ButtonDelete.Enabled = true; - ButtonRuleUp.Enabled = true; - ButtonRuleDown.Enabled = true; - ButtonRuleCopy.Enabled = true; - ButtonRuleMove.Enabled = true; - buttonRuleToggleEnabled.Enabled = true; + this.ButtonEdit.Enabled = true; + this.ButtonDelete.Enabled = true; + this.ButtonRuleUp.Enabled = true; + this.ButtonRuleDown.Enabled = true; + this.ButtonRuleCopy.Enabled = true; + this.ButtonRuleMove.Enabled = true; + this.buttonRuleToggleEnabled.Enabled = true; } else { - ButtonEdit.Enabled = false; - ButtonDelete.Enabled = false; - ButtonRuleUp.Enabled = false; - ButtonRuleDown.Enabled = false; - ButtonRuleCopy.Enabled = false; - ButtonRuleMove.Enabled = false; - buttonRuleToggleEnabled.Enabled = false; + this.ButtonEdit.Enabled = false; + this.ButtonDelete.Enabled = false; + this.ButtonRuleUp.Enabled = false; + this.ButtonRuleDown.Enabled = false; + this.ButtonRuleCopy.Enabled = false; + this.ButtonRuleMove.Enabled = false; + this.buttonRuleToggleEnabled.Enabled = false; } } else { - ButtonNew.Enabled = false; - ButtonEdit.Enabled = false; - ButtonDelete.Enabled = false; - ButtonRuleUp.Enabled = false; - ButtonRuleDown.Enabled = false; - ButtonRuleCopy.Enabled = false; - ButtonRuleMove.Enabled = false; - buttonRuleToggleEnabled.Enabled = false; + this.ButtonNew.Enabled = false; + this.ButtonEdit.Enabled = false; + this.ButtonDelete.Enabled = false; + this.ButtonRuleUp.Enabled = false; + this.ButtonRuleDown.Enabled = false; + this.ButtonRuleCopy.Enabled = false; + this.ButtonRuleMove.Enabled = false; + this.buttonRuleToggleEnabled.Enabled = false; } this.LabelTabType.Text = tab.TabType switch @@ -225,16 +232,15 @@ namespace OpenTween _ => "UNKNOWN", }; - ButtonRenameTab.Enabled = true; if (tab.IsDefaultTabType || tab.Protected) { - ButtonDeleteTab.Enabled = false; + this.ButtonDeleteTab.Enabled = false; } else { - ButtonDeleteTab.Enabled = true; + this.ButtonDeleteTab.Enabled = true; } - ButtonClose.Enabled = true; + this.ButtonClose.Enabled = true; } public void SetCurrent(string tabName) @@ -248,154 +254,154 @@ namespace OpenTween public void AddNewFilter(string id, string msg) { - //元フォームから直接呼ばれる - ButtonNew.Enabled = false; - ButtonEdit.Enabled = false; - ButtonRuleUp.Enabled = false; - ButtonRuleDown.Enabled = false; - ButtonRuleCopy.Enabled = false; - ButtonRuleMove.Enabled = false; - buttonRuleToggleEnabled.Enabled = false; - ButtonDelete.Enabled = false; - ButtonClose.Enabled = false; - EditFilterGroup.Enabled = true; - ListTabs.Enabled = false; - GroupTab.Enabled = false; - ListFilters.Enabled = false; - - RadioAND.Checked = true; - RadioPLUS.Checked = false; - UID.Text = id; - UID.SelectAll(); - MSG1.Text = msg; - MSG1.SelectAll(); - MSG2.Text = id + msg; - MSG2.SelectAll(); - TextSource.Text = ""; - UID.Enabled = true; - MSG1.Enabled = true; - MSG2.Enabled = false; - CheckRegex.Checked = false; - CheckURL.Checked = false; - CheckCaseSensitive.Checked = false; - CheckRetweet.Checked = false; - CheckLambda.Checked = false; - - RadioExAnd.Checked = true; - RadioExPLUS.Checked = false; - ExUID.Text = ""; - ExUID.SelectAll(); - ExMSG1.Text = ""; - ExMSG1.SelectAll(); - ExMSG2.Text = ""; - ExMSG2.SelectAll(); - TextExSource.Text = ""; - ExUID.Enabled = true; - ExMSG1.Enabled = true; - ExMSG2.Enabled = false; - CheckExRegex.Checked = false; - CheckExURL.Checked = false; - CheckExCaseSensitive.Checked = false; - CheckExRetweet.Checked = false; - CheckExLambDa.Checked = false; - - OptCopy.Checked = true; - CheckMark.Checked = true; - UID.Focus(); - _mode = EDITMODE.AddNew; - _directAdd = true; + // 元フォームから直接呼ばれる + this.ButtonNew.Enabled = false; + this.ButtonEdit.Enabled = false; + this.ButtonRuleUp.Enabled = false; + this.ButtonRuleDown.Enabled = false; + this.ButtonRuleCopy.Enabled = false; + this.ButtonRuleMove.Enabled = false; + this.buttonRuleToggleEnabled.Enabled = false; + this.ButtonDelete.Enabled = false; + this.ButtonClose.Enabled = false; + this.EditFilterGroup.Enabled = true; + this.ListTabs.Enabled = false; + this.GroupTab.Enabled = false; + this.ListFilters.Enabled = false; + + this.RadioAND.Checked = true; + this.RadioPLUS.Checked = false; + this.UID.Text = id; + this.UID.SelectAll(); + this.MSG1.Text = msg; + this.MSG1.SelectAll(); + this.MSG2.Text = id + msg; + this.MSG2.SelectAll(); + this.TextSource.Text = ""; + this.UID.Enabled = true; + this.MSG1.Enabled = true; + this.MSG2.Enabled = false; + this.CheckRegex.Checked = false; + this.CheckURL.Checked = false; + this.CheckCaseSensitive.Checked = false; + this.CheckRetweet.Checked = false; + this.CheckLambda.Checked = false; + + this.RadioExAnd.Checked = true; + this.RadioExPLUS.Checked = false; + this.ExUID.Text = ""; + this.ExUID.SelectAll(); + this.ExMSG1.Text = ""; + this.ExMSG1.SelectAll(); + this.ExMSG2.Text = ""; + this.ExMSG2.SelectAll(); + this.TextExSource.Text = ""; + this.ExUID.Enabled = true; + this.ExMSG1.Enabled = true; + this.ExMSG2.Enabled = false; + this.CheckExRegex.Checked = false; + this.CheckExURL.Checked = false; + this.CheckExCaseSensitive.Checked = false; + this.CheckExRetweet.Checked = false; + this.CheckExLambDa.Checked = false; + + this.OptCopy.Checked = true; + this.CheckMark.Checked = true; + this.UID.Focus(); + this._mode = EDITMODE.AddNew; + this._directAdd = true; } private void ButtonNew_Click(object sender, EventArgs e) { - ButtonNew.Enabled = false; - ButtonEdit.Enabled = false; - ButtonClose.Enabled = false; - ButtonRuleUp.Enabled = false; - ButtonRuleDown.Enabled = false; - ButtonRuleCopy.Enabled = false; - ButtonRuleMove.Enabled = false; - buttonRuleToggleEnabled.Enabled = false; - ButtonDelete.Enabled = false; - ButtonClose.Enabled = false; - EditFilterGroup.Enabled = true; - ListTabs.Enabled = false; - GroupTab.Enabled = false; - ListFilters.Enabled = false; - - RadioAND.Checked = true; - RadioPLUS.Checked = false; - UID.Text = ""; - MSG1.Text = ""; - MSG2.Text = ""; - TextSource.Text = ""; - UID.Enabled = true; - MSG1.Enabled = true; - MSG2.Enabled = false; - CheckRegex.Checked = false; - CheckURL.Checked = false; - CheckCaseSensitive.Checked = false; - CheckRetweet.Checked = false; - CheckLambda.Checked = false; - - RadioExAnd.Checked = true; - RadioExPLUS.Checked = false; - ExUID.Text = ""; - ExMSG1.Text = ""; - ExMSG2.Text = ""; - TextExSource.Text = ""; - ExUID.Enabled = true; - ExMSG1.Enabled = true; - ExMSG2.Enabled = false; - CheckExRegex.Checked = false; - CheckExURL.Checked = false; - CheckExCaseSensitive.Checked = false; - CheckExRetweet.Checked = false; - CheckExLambDa.Checked = false; - - OptCopy.Checked = true; - CheckMark.Checked = true; - UID.Focus(); - _mode = EDITMODE.AddNew; + this.ButtonNew.Enabled = false; + this.ButtonEdit.Enabled = false; + this.ButtonClose.Enabled = false; + this.ButtonRuleUp.Enabled = false; + this.ButtonRuleDown.Enabled = false; + this.ButtonRuleCopy.Enabled = false; + this.ButtonRuleMove.Enabled = false; + this.buttonRuleToggleEnabled.Enabled = false; + this.ButtonDelete.Enabled = false; + this.ButtonClose.Enabled = false; + this.EditFilterGroup.Enabled = true; + this.ListTabs.Enabled = false; + this.GroupTab.Enabled = false; + this.ListFilters.Enabled = false; + + this.RadioAND.Checked = true; + this.RadioPLUS.Checked = false; + this.UID.Text = ""; + this.MSG1.Text = ""; + this.MSG2.Text = ""; + this.TextSource.Text = ""; + this.UID.Enabled = true; + this.MSG1.Enabled = true; + this.MSG2.Enabled = false; + this.CheckRegex.Checked = false; + this.CheckURL.Checked = false; + this.CheckCaseSensitive.Checked = false; + this.CheckRetweet.Checked = false; + this.CheckLambda.Checked = false; + + this.RadioExAnd.Checked = true; + this.RadioExPLUS.Checked = false; + this.ExUID.Text = ""; + this.ExMSG1.Text = ""; + this.ExMSG2.Text = ""; + this.TextExSource.Text = ""; + this.ExUID.Enabled = true; + this.ExMSG1.Enabled = true; + this.ExMSG2.Enabled = false; + this.CheckExRegex.Checked = false; + this.CheckExURL.Checked = false; + this.CheckExCaseSensitive.Checked = false; + this.CheckExRetweet.Checked = false; + this.CheckExLambDa.Checked = false; + + this.OptCopy.Checked = true; + this.CheckMark.Checked = true; + this.UID.Focus(); + this._mode = EDITMODE.AddNew; } private void ButtonEdit_Click(object sender, EventArgs e) { - if (ListFilters.SelectedIndex == -1) return; - - ShowDetail(); - - var idx = ListFilters.SelectedIndex; - ListFilters.SelectedIndex = -1; - ListFilters.SelectedIndex = idx; - ListFilters.Enabled = false; - - ButtonNew.Enabled = false; - ButtonEdit.Enabled = false; - ButtonDelete.Enabled = false; - ButtonClose.Enabled = false; - ButtonRuleUp.Enabled = false; - ButtonRuleDown.Enabled = false; - ButtonRuleCopy.Enabled = false; - ButtonRuleMove.Enabled = false; - buttonRuleToggleEnabled.Enabled = false; - EditFilterGroup.Enabled = true; - ListTabs.Enabled = false; - GroupTab.Enabled = false; - - _mode = EDITMODE.Edit; + if (this.ListFilters.SelectedIndex == -1) return; + + this.ShowDetail(); + + var idx = this.ListFilters.SelectedIndex; + this.ListFilters.SelectedIndex = -1; + this.ListFilters.SelectedIndex = idx; + this.ListFilters.Enabled = false; + + this.ButtonNew.Enabled = false; + this.ButtonEdit.Enabled = false; + this.ButtonDelete.Enabled = false; + this.ButtonClose.Enabled = false; + this.ButtonRuleUp.Enabled = false; + this.ButtonRuleDown.Enabled = false; + this.ButtonRuleCopy.Enabled = false; + this.ButtonRuleMove.Enabled = false; + this.buttonRuleToggleEnabled.Enabled = false; + this.EditFilterGroup.Enabled = true; + this.ListTabs.Enabled = false; + this.GroupTab.Enabled = false; + + this._mode = EDITMODE.Edit; } private void ButtonDelete_Click(object sender, EventArgs e) { - var selectedCount = ListFilters.SelectedIndices.Count; + var selectedCount = this.ListFilters.SelectedIndices.Count; if (selectedCount == 0) return; string tmp; if (selectedCount == 1) { - tmp = string.Format(Properties.Resources.ButtonDelete_ClickText1, Environment.NewLine, ListFilters.SelectedItem); + tmp = string.Format(Properties.Resources.ButtonDelete_ClickText1, Environment.NewLine, this.ListFilters.SelectedItem); } else { @@ -405,53 +411,53 @@ namespace OpenTween var rslt = MessageBox.Show(tmp, Properties.Resources.ButtonDelete_ClickText2, MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (rslt == DialogResult.Cancel) return; - var indices = ListFilters.SelectedIndices.Cast().Reverse().ToArray(); // 後ろの要素から削除 + var indices = this.ListFilters.SelectedIndices.Cast().Reverse().ToArray(); // 後ろの要素から削除 var tab = (FilterTabModel)this.SelectedTab!; - using (ControlTransaction.Update(ListFilters)) + using (ControlTransaction.Update(this.ListFilters)) { foreach (var idx in indices) { - tab.RemoveFilter((PostFilterRule)ListFilters.Items[idx]); - ListFilters.Items.RemoveAt(idx); + tab.RemoveFilter((PostFilterRule)this.ListFilters.Items[idx]); + this.ListFilters.Items.RemoveAt(idx); } } } private void ButtonCancel_Click(object sender, EventArgs e) { - ListTabs.Enabled = true; - GroupTab.Enabled = true; - ListFilters.Enabled = true; - ListFilters.Focus(); - if (ListFilters.SelectedIndex != -1) - { - ShowDetail(); - } - EditFilterGroup.Enabled = false; - ButtonNew.Enabled = true; - if (ListFilters.SelectedIndex > -1) - { - ButtonEdit.Enabled = true; - ButtonDelete.Enabled = true; - ButtonRuleUp.Enabled = true; - ButtonRuleDown.Enabled = true; - ButtonRuleCopy.Enabled = true; - ButtonRuleMove.Enabled = true; - buttonRuleToggleEnabled.Enabled = true; + this.ListTabs.Enabled = true; + this.GroupTab.Enabled = true; + this.ListFilters.Enabled = true; + this.ListFilters.Focus(); + if (this.ListFilters.SelectedIndex != -1) + { + this.ShowDetail(); + } + this.EditFilterGroup.Enabled = false; + this.ButtonNew.Enabled = true; + if (this.ListFilters.SelectedIndex > -1) + { + this.ButtonEdit.Enabled = true; + this.ButtonDelete.Enabled = true; + this.ButtonRuleUp.Enabled = true; + this.ButtonRuleDown.Enabled = true; + this.ButtonRuleCopy.Enabled = true; + this.ButtonRuleMove.Enabled = true; + this.buttonRuleToggleEnabled.Enabled = true; } else { - ButtonEdit.Enabled = false; - ButtonDelete.Enabled = false; - ButtonRuleUp.Enabled = false; - ButtonRuleDown.Enabled = false; - ButtonRuleCopy.Enabled = false; - ButtonRuleMove.Enabled = false; - buttonRuleToggleEnabled.Enabled = false; + this.ButtonEdit.Enabled = false; + this.ButtonDelete.Enabled = false; + this.ButtonRuleUp.Enabled = false; + this.ButtonRuleDown.Enabled = false; + this.ButtonRuleCopy.Enabled = false; + this.ButtonRuleMove.Enabled = false; + this.buttonRuleToggleEnabled.Enabled = false; } - ButtonClose.Enabled = true; - if (_directAdd) + this.ButtonClose.Enabled = true; + if (this._directAdd) { this.Close(); } @@ -459,150 +465,150 @@ namespace OpenTween private void ShowDetail() { - if (_directAdd) return; + if (this._directAdd) return; - if (ListFilters.SelectedIndex > -1) + if (this.ListFilters.SelectedIndex > -1) { - var fc = (PostFilterRule)ListFilters.SelectedItem; + var fc = (PostFilterRule)this.ListFilters.SelectedItem; if (fc.UseNameField) { - RadioAND.Checked = true; - RadioPLUS.Checked = false; - UID.Enabled = true; - MSG1.Enabled = true; - MSG2.Enabled = false; - UID.Text = fc.FilterName; - UID.SelectAll(); - MSG1.Text = string.Join(" ", fc.FilterBody); - MSG1.SelectAll(); - MSG2.Text = ""; + this.RadioAND.Checked = true; + this.RadioPLUS.Checked = false; + this.UID.Enabled = true; + this.MSG1.Enabled = true; + this.MSG2.Enabled = false; + this.UID.Text = fc.FilterName; + this.UID.SelectAll(); + this.MSG1.Text = string.Join(" ", fc.FilterBody); + this.MSG1.SelectAll(); + this.MSG2.Text = ""; } else { - RadioPLUS.Checked = true; - RadioAND.Checked = false; - UID.Enabled = false; - MSG1.Enabled = false; - MSG2.Enabled = true; - UID.Text = ""; - MSG1.Text = ""; - MSG2.Text = string.Join(" ", fc.FilterBody); - MSG2.SelectAll(); + this.RadioPLUS.Checked = true; + this.RadioAND.Checked = false; + this.UID.Enabled = false; + this.MSG1.Enabled = false; + this.MSG2.Enabled = true; + this.UID.Text = ""; + this.MSG1.Text = ""; + this.MSG2.Text = string.Join(" ", fc.FilterBody); + this.MSG2.SelectAll(); } - TextSource.Text = fc.FilterSource; - CheckRegex.Checked = fc.UseRegex; - CheckURL.Checked = fc.FilterByUrl; - CheckCaseSensitive.Checked = fc.CaseSensitive; - CheckRetweet.Checked = fc.FilterRt; - CheckLambda.Checked = fc.UseLambda; + this.TextSource.Text = fc.FilterSource; + this.CheckRegex.Checked = fc.UseRegex; + this.CheckURL.Checked = fc.FilterByUrl; + this.CheckCaseSensitive.Checked = fc.CaseSensitive; + this.CheckRetweet.Checked = fc.FilterRt; + this.CheckLambda.Checked = fc.UseLambda; if (fc.ExUseNameField) { - RadioExAnd.Checked = true; - RadioExPLUS.Checked = false; - ExUID.Enabled = true; - ExMSG1.Enabled = true; - ExMSG2.Enabled = false; - ExUID.Text = fc.ExFilterName; - ExUID.SelectAll(); - ExMSG1.Text = string.Join(" ", fc.ExFilterBody); - ExMSG1.SelectAll(); - ExMSG2.Text = ""; + this.RadioExAnd.Checked = true; + this.RadioExPLUS.Checked = false; + this.ExUID.Enabled = true; + this.ExMSG1.Enabled = true; + this.ExMSG2.Enabled = false; + this.ExUID.Text = fc.ExFilterName; + this.ExUID.SelectAll(); + this.ExMSG1.Text = string.Join(" ", fc.ExFilterBody); + this.ExMSG1.SelectAll(); + this.ExMSG2.Text = ""; } else { - RadioExPLUS.Checked = true; - RadioExAnd.Checked = false; - ExUID.Enabled = false; - ExMSG1.Enabled = false; - ExMSG2.Enabled = true; - ExUID.Text = ""; - ExMSG1.Text = ""; - ExMSG2.Text = string.Join(" ", fc.ExFilterBody); - ExMSG2.SelectAll(); + this.RadioExPLUS.Checked = true; + this.RadioExAnd.Checked = false; + this.ExUID.Enabled = false; + this.ExMSG1.Enabled = false; + this.ExMSG2.Enabled = true; + this.ExUID.Text = ""; + this.ExMSG1.Text = ""; + this.ExMSG2.Text = string.Join(" ", fc.ExFilterBody); + this.ExMSG2.SelectAll(); } - TextExSource.Text = fc.ExFilterSource; - CheckExRegex.Checked = fc.ExUseRegex; - CheckExURL.Checked = fc.ExFilterByUrl; - CheckExCaseSensitive.Checked = fc.ExCaseSensitive; - CheckExRetweet.Checked = fc.ExFilterRt; - CheckExLambDa.Checked = fc.ExUseLambda; + this.TextExSource.Text = fc.ExFilterSource; + this.CheckExRegex.Checked = fc.ExUseRegex; + this.CheckExURL.Checked = fc.ExFilterByUrl; + this.CheckExCaseSensitive.Checked = fc.ExCaseSensitive; + this.CheckExRetweet.Checked = fc.ExFilterRt; + this.CheckExLambDa.Checked = fc.ExUseLambda; if (fc.MoveMatches) { - OptMove.Checked = true; + this.OptMove.Checked = true; } else { - OptCopy.Checked = true; + this.OptCopy.Checked = true; } - CheckMark.Checked = fc.MarkMatches; + this.CheckMark.Checked = fc.MarkMatches; - ButtonEdit.Enabled = true; - ButtonDelete.Enabled = true; - ButtonRuleUp.Enabled = true; - ButtonRuleDown.Enabled = true; - ButtonRuleCopy.Enabled = true; - ButtonRuleMove.Enabled = true; - buttonRuleToggleEnabled.Enabled = true; + this.ButtonEdit.Enabled = true; + this.ButtonDelete.Enabled = true; + this.ButtonRuleUp.Enabled = true; + this.ButtonRuleDown.Enabled = true; + this.ButtonRuleCopy.Enabled = true; + this.ButtonRuleMove.Enabled = true; + this.buttonRuleToggleEnabled.Enabled = true; } else { - RadioAND.Checked = true; - RadioPLUS.Checked = false; - UID.Enabled = true; - MSG1.Enabled = true; - MSG2.Enabled = false; - UID.Text = ""; - MSG1.Text = ""; - MSG2.Text = ""; - TextSource.Text = ""; - CheckRegex.Checked = false; - CheckURL.Checked = false; - CheckCaseSensitive.Checked = false; - CheckRetweet.Checked = false; - CheckLambda.Checked = false; - - RadioExAnd.Checked = true; - RadioExPLUS.Checked = false; - ExUID.Enabled = true; - ExMSG1.Enabled = true; - ExMSG2.Enabled = false; - ExUID.Text = ""; - ExMSG1.Text = ""; - ExMSG2.Text = ""; - TextExSource.Text = ""; - CheckExRegex.Checked = false; - CheckExURL.Checked = false; - CheckExCaseSensitive.Checked = false; - CheckExRetweet.Checked = false; - CheckExLambDa.Checked = false; - - OptCopy.Checked = true; - CheckMark.Checked = true; - - ButtonEdit.Enabled = false; - ButtonDelete.Enabled = false; - ButtonRuleUp.Enabled = false; - ButtonRuleDown.Enabled = false; - ButtonRuleCopy.Enabled = false; - ButtonRuleMove.Enabled = false; - buttonRuleToggleEnabled.Enabled = false; + this.RadioAND.Checked = true; + this.RadioPLUS.Checked = false; + this.UID.Enabled = true; + this.MSG1.Enabled = true; + this.MSG2.Enabled = false; + this.UID.Text = ""; + this.MSG1.Text = ""; + this.MSG2.Text = ""; + this.TextSource.Text = ""; + this.CheckRegex.Checked = false; + this.CheckURL.Checked = false; + this.CheckCaseSensitive.Checked = false; + this.CheckRetweet.Checked = false; + this.CheckLambda.Checked = false; + + this.RadioExAnd.Checked = true; + this.RadioExPLUS.Checked = false; + this.ExUID.Enabled = true; + this.ExMSG1.Enabled = true; + this.ExMSG2.Enabled = false; + this.ExUID.Text = ""; + this.ExMSG1.Text = ""; + this.ExMSG2.Text = ""; + this.TextExSource.Text = ""; + this.CheckExRegex.Checked = false; + this.CheckExURL.Checked = false; + this.CheckExCaseSensitive.Checked = false; + this.CheckExRetweet.Checked = false; + this.CheckExLambDa.Checked = false; + + this.OptCopy.Checked = true; + this.CheckMark.Checked = true; + + this.ButtonEdit.Enabled = false; + this.ButtonDelete.Enabled = false; + this.ButtonRuleUp.Enabled = false; + this.ButtonRuleDown.Enabled = false; + this.ButtonRuleCopy.Enabled = false; + this.ButtonRuleMove.Enabled = false; + this.buttonRuleToggleEnabled.Enabled = false; } } private void RadioAND_CheckedChanged(object sender, EventArgs e) { - var flg = RadioAND.Checked; - UID.Enabled = flg; - MSG1.Enabled = flg; - MSG2.Enabled = !flg; + var flg = this.RadioAND.Checked; + this.UID.Enabled = flg; + this.MSG1.Enabled = flg; + this.MSG2.Enabled = !flg; } private void ButtonOK_Click(object sender, EventArgs e) { - //入力チェック - if (!CheckMatchRule(out var isBlankMatch) || !CheckExcludeRule(out var isBlankExclude)) + // 入力チェック + if (!this.CheckMatchRule(out var isBlankMatch) || !this.CheckExcludeRule(out var isBlankExclude)) { return; } @@ -613,18 +619,18 @@ namespace OpenTween } var tab = (FilterTabModel)this.SelectedTab!; - var i = ListFilters.SelectedIndex; + var i = this.ListFilters.SelectedIndex; PostFilterRule ft; - if (_mode == EDITMODE.AddNew) + if (this._mode == EDITMODE.AddNew) ft = new PostFilterRule(); else ft = (PostFilterRule)this.ListFilters.SelectedItem; if (tab.TabType != MyCommon.TabUsageType.Mute) { - ft.MoveMatches = OptMove.Checked; - ft.MarkMatches = CheckMark.Checked; + ft.MoveMatches = this.OptMove.Checked; + ft.MarkMatches = this.CheckMark.Checked; } else { @@ -633,9 +639,9 @@ namespace OpenTween } var bdy = ""; - if (RadioAND.Checked) + if (this.RadioAND.Checked) { - ft.FilterName = UID.Text; + ft.FilterName = this.UID.Text; var owner = (TweenMain)this.Owner; var cnt = owner.AtIdSupl.ItemCount; owner.AtIdSupl.AddItem("@" + ft.FilterName); @@ -644,84 +650,84 @@ namespace OpenTween owner.MarkSettingAtIdModified(); } ft.UseNameField = true; - bdy = MSG1.Text; + bdy = this.MSG1.Text; } else { ft.FilterName = ""; ft.UseNameField = false; - bdy = MSG2.Text; + bdy = this.MSG2.Text; } - ft.FilterSource = TextSource.Text; + ft.FilterSource = this.TextSource.Text; - if (CheckRegex.Checked || CheckLambda.Checked) + if (this.CheckRegex.Checked || this.CheckLambda.Checked) { ft.FilterBody = new[] { bdy }; } else { ft.FilterBody = bdy.Split(' ', ' ') - .Where(x => !string.IsNullOrEmpty(x)) + .Where(x => !MyCommon.IsNullOrEmpty(x)) .ToArray(); } - ft.UseRegex = CheckRegex.Checked; - ft.FilterByUrl = CheckURL.Checked; - ft.CaseSensitive = CheckCaseSensitive.Checked; - ft.FilterRt = CheckRetweet.Checked; - ft.UseLambda = CheckLambda.Checked; + ft.UseRegex = this.CheckRegex.Checked; + ft.FilterByUrl = this.CheckURL.Checked; + ft.CaseSensitive = this.CheckCaseSensitive.Checked; + ft.FilterRt = this.CheckRetweet.Checked; + ft.UseLambda = this.CheckLambda.Checked; bdy = ""; - if (RadioExAnd.Checked) + if (this.RadioExAnd.Checked) { - ft.ExFilterName = ExUID.Text; + ft.ExFilterName = this.ExUID.Text; ft.ExUseNameField = true; - bdy = ExMSG1.Text; + bdy = this.ExMSG1.Text; } else { ft.ExFilterName = ""; ft.ExUseNameField = false; - bdy = ExMSG2.Text; + bdy = this.ExMSG2.Text; } - ft.ExFilterSource = TextExSource.Text; + ft.ExFilterSource = this.TextExSource.Text; - if (CheckExRegex.Checked || CheckExLambDa.Checked) + if (this.CheckExRegex.Checked || this.CheckExLambDa.Checked) { ft.ExFilterBody = new[] { bdy }; } else { ft.ExFilterBody = bdy.Split(' ', ' ') - .Where(x => !string.IsNullOrEmpty(x)) + .Where(x => !MyCommon.IsNullOrEmpty(x)) .ToArray(); } - ft.ExUseRegex = CheckExRegex.Checked; - ft.ExFilterByUrl = CheckExURL.Checked; - ft.ExCaseSensitive = CheckExCaseSensitive.Checked; - ft.ExFilterRt = CheckExRetweet.Checked; - ft.ExUseLambda = CheckExLambDa.Checked; + ft.ExUseRegex = this.CheckExRegex.Checked; + ft.ExFilterByUrl = this.CheckExURL.Checked; + ft.ExCaseSensitive = this.CheckExCaseSensitive.Checked; + ft.ExFilterRt = this.CheckExRetweet.Checked; + ft.ExUseLambda = this.CheckExLambDa.Checked; - if (_mode == EDITMODE.AddNew) + if (this._mode == EDITMODE.AddNew) { if (!tab.AddFilter(ft)) MessageBox.Show(Properties.Resources.ButtonOK_ClickText4, Properties.Resources.ButtonOK_ClickText2, MessageBoxButtons.OK, MessageBoxIcon.Error); } - SetFilters(tab); - ListFilters.SelectedIndex = -1; - if (_mode == EDITMODE.AddNew) + this.SetFilters(tab); + this.ListFilters.SelectedIndex = -1; + if (this._mode == EDITMODE.AddNew) { - ListFilters.SelectedIndex = ListFilters.Items.Count - 1; + this.ListFilters.SelectedIndex = this.ListFilters.Items.Count - 1; } else { - ListFilters.SelectedIndex = i; + this.ListFilters.SelectedIndex = i; } - _mode = EDITMODE.None; + this._mode = EDITMODE.None; - if (_directAdd) + if (this._directAdd) { this.Close(); } @@ -747,31 +753,31 @@ namespace OpenTween private bool CheckMatchRule(out bool isBlank) { isBlank = false; - if (RadioAND.Checked) + if (this.RadioAND.Checked) { - if (string.IsNullOrEmpty(UID.Text) && string.IsNullOrEmpty(MSG1.Text) && string.IsNullOrEmpty(TextSource.Text) && CheckRetweet.Checked == false) + if (MyCommon.IsNullOrEmpty(this.UID.Text) && MyCommon.IsNullOrEmpty(this.MSG1.Text) && MyCommon.IsNullOrEmpty(this.TextSource.Text) && this.CheckRetweet.Checked == false) { isBlank = true; return true; } - if (CheckLambda.Checked) + if (this.CheckLambda.Checked) { - if (!IsValidLambdaExp(UID.Text)) + if (!this.IsValidLambdaExp(this.UID.Text)) { return false; } - if (!IsValidLambdaExp(MSG1.Text)) + if (!this.IsValidLambdaExp(this.MSG1.Text)) { return false; } } - else if (CheckRegex.Checked) + else if (this.CheckRegex.Checked) { - if (!IsValidRegexp(UID.Text)) + if (!this.IsValidRegexp(this.UID.Text)) { return false; } - if (!IsValidRegexp(MSG1.Text)) + if (!this.IsValidRegexp(this.MSG1.Text)) { return false; } @@ -779,22 +785,22 @@ namespace OpenTween } else { - if (string.IsNullOrEmpty(MSG2.Text) && string.IsNullOrEmpty(TextSource.Text) && CheckRetweet.Checked == false) + if (MyCommon.IsNullOrEmpty(this.MSG2.Text) && MyCommon.IsNullOrEmpty(this.TextSource.Text) && this.CheckRetweet.Checked == false) { isBlank = true; return true; } - if (CheckLambda.Checked && !IsValidLambdaExp(MSG2.Text)) + if (this.CheckLambda.Checked && !this.IsValidLambdaExp(this.MSG2.Text)) { return false; } - else if (CheckRegex.Checked && !IsValidRegexp(MSG2.Text)) + else if (this.CheckRegex.Checked && !this.IsValidRegexp(this.MSG2.Text)) { return false; } } - if (CheckRegex.Checked && !IsValidRegexp(TextSource.Text)) + if (this.CheckRegex.Checked && !this.IsValidRegexp(this.TextSource.Text)) { return false; } @@ -804,31 +810,31 @@ namespace OpenTween private bool CheckExcludeRule(out bool isBlank) { isBlank = false; - if (RadioExAnd.Checked) + if (this.RadioExAnd.Checked) { - if (string.IsNullOrEmpty(ExUID.Text) && string.IsNullOrEmpty(ExMSG1.Text) && string.IsNullOrEmpty(TextExSource.Text) && CheckExRetweet.Checked == false) + if (MyCommon.IsNullOrEmpty(this.ExUID.Text) && MyCommon.IsNullOrEmpty(this.ExMSG1.Text) && MyCommon.IsNullOrEmpty(this.TextExSource.Text) && this.CheckExRetweet.Checked == false) { isBlank = true; return true; } - if (CheckExLambDa.Checked) + if (this.CheckExLambDa.Checked) { - if (!IsValidLambdaExp(ExUID.Text)) + if (!this.IsValidLambdaExp(this.ExUID.Text)) { return false; } - if (!IsValidLambdaExp(ExMSG1.Text)) + if (!this.IsValidLambdaExp(this.ExMSG1.Text)) { return false; } } - else if (CheckExRegex.Checked) + else if (this.CheckExRegex.Checked) { - if (!IsValidRegexp(ExUID.Text)) + if (!this.IsValidRegexp(this.ExUID.Text)) { return false; } - if (!IsValidRegexp(ExMSG1.Text)) + if (!this.IsValidRegexp(this.ExMSG1.Text)) { return false; } @@ -836,22 +842,22 @@ namespace OpenTween } else { - if (string.IsNullOrEmpty(ExMSG2.Text) && string.IsNullOrEmpty(TextExSource.Text) && CheckExRetweet.Checked == false) + if (MyCommon.IsNullOrEmpty(this.ExMSG2.Text) && MyCommon.IsNullOrEmpty(this.TextExSource.Text) && this.CheckExRetweet.Checked == false) { isBlank = true; return true; } - if (CheckExLambDa.Checked && !IsValidLambdaExp(ExMSG2.Text)) + if (this.CheckExLambDa.Checked && !this.IsValidLambdaExp(this.ExMSG2.Text)) { return false; } - else if (CheckExRegex.Checked && !IsValidRegexp(ExMSG2.Text)) + else if (this.CheckExRegex.Checked && !this.IsValidRegexp(this.ExMSG2.Text)) { return false; } } - if (CheckExRegex.Checked && !IsValidRegexp(TextExSource.Text)) + if (this.CheckExRegex.Checked && !this.IsValidRegexp(this.TextExSource.Text)) { return false; } @@ -861,10 +867,10 @@ namespace OpenTween private void ListFilters_SelectedIndexChanged(object sender, EventArgs e) { - if (_multiSelState != MultiSelectionState.None) //複数選択処理中は無視する + if (this._multiSelState != MultiSelectionState.None) // 複数選択処理中は無視する return; - ShowDetail(); + this.ShowDetail(); var selectedCount = this.ListFilters.SelectedIndices.Count; if (selectedCount == 0) @@ -892,30 +898,30 @@ namespace OpenTween { if (e.KeyCode == Keys.Escape) { - if (EditFilterGroup.Enabled) - ButtonCancel_Click(this.ButtonCancel, EventArgs.Empty); + if (this.EditFilterGroup.Enabled) + this.ButtonCancel_Click(this.ButtonCancel, EventArgs.Empty); else - ButtonClose_Click(this.ButtonClose, EventArgs.Empty); + this.ButtonClose_Click(this.ButtonClose, EventArgs.Empty); } } private void ListFilters_DoubleClick(object sender, EventArgs e) { - var idx = ListFilters.SelectedIndex; + var idx = this.ListFilters.SelectedIndex; if (idx == -1) return; - var midx = ListFilters.IndexFromPoint(ListFilters.PointToClient(Control.MousePosition)); + var midx = this.ListFilters.IndexFromPoint(this.ListFilters.PointToClient(Control.MousePosition)); if (midx == ListBox.NoMatches || idx != midx) return; - ButtonEdit_Click(sender, e); + this.ButtonEdit_Click(sender, e); } private void FilterDialog_Shown(object sender, EventArgs e) { - ListTabs.DisplayMember = nameof(TabModel.TabName); + this.ListTabs.DisplayMember = nameof(TabModel.TabName); - ComboSound.Items.Clear(); - ComboSound.Items.Add(""); + this.ComboSound.Items.Clear(); + this.ComboSound.Items.Add(""); var oDir = new DirectoryInfo(Application.StartupPath + Path.DirectorySeparatorChar); if (Directory.Exists(Path.Combine(Application.StartupPath, "Sounds"))) { @@ -923,21 +929,21 @@ namespace OpenTween } foreach (var oFile in oDir.GetFiles("*.wav")) { - ComboSound.Items.Add(oFile.Name); + this.ComboSound.Items.Add(oFile.Name); } - idlist.Clear(); + this.idlist.Clear(); foreach (var tmp in ((TweenMain)this.Owner).AtIdSupl.GetItemList()) { - idlist.Add(tmp.Remove(0, 1)); // @文字削除 + this.idlist.Add(tmp.Remove(0, 1)); // @文字削除 } - UID.AutoCompleteCustomSource.Clear(); - UID.AutoCompleteCustomSource.AddRange(idlist.ToArray()); + this.UID.AutoCompleteCustomSource.Clear(); + this.UID.AutoCompleteCustomSource.AddRange(this.idlist.ToArray()); - ExUID.AutoCompleteCustomSource.Clear(); - ExUID.AutoCompleteCustomSource.AddRange(idlist.ToArray()); + this.ExUID.AutoCompleteCustomSource.Clear(); + this.ExUID.AutoCompleteCustomSource.AddRange(this.idlist.ToArray()); - //選択タブ変更 + // 選択タブ変更 this.ListTabs.SelectedIndex = this.selectedTabIndex; } @@ -947,9 +953,9 @@ namespace OpenTween var selectedTab = this.SelectedTab; if (selectedTab != null) - SetFilters(selectedTab); + this.SetFilters(selectedTab); else - ListFilters.Items.Clear(); + this.ListFilters.Items.Clear(); } private async void ButtonAddTab_Click(object sender, EventArgs e) @@ -958,16 +964,16 @@ namespace OpenTween MyCommon.TabUsageType tabType; using (var inputName = new InputTabName()) { - inputName.TabName = _sts.MakeTabName("MyTab"); + inputName.TabName = this._sts.MakeTabName("MyTab"); inputName.IsShowUsage = true; inputName.ShowDialog(); if (inputName.DialogResult == DialogResult.Cancel) return; tabName = inputName.TabName; tabType = inputName.Usage; } - if (!string.IsNullOrEmpty(tabName)) + if (!MyCommon.IsNullOrEmpty(tabName)) { - //List対応 + // List対応 ListElement? list = null; if (tabType == MyCommon.TabUsageType.Lists) { @@ -1012,7 +1018,7 @@ namespace OpenTween return; } - if (!_sts.AddTab(tab) || !((TweenMain)this.Owner).AddNewTab(tab, startup: false)) + if (!this._sts.AddTab(tab) || !((TweenMain)this.Owner).AddNewTab(tab, startup: false)) { var tmp = string.Format(Properties.Resources.AddTabMenuItem_ClickText1, tabName); MessageBox.Show(tmp, Properties.Resources.AddTabMenuItem_ClickText2, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); @@ -1032,13 +1038,13 @@ namespace OpenTween if (selectedTab != null) { var tb = selectedTab.TabName; - var idx = ListTabs.SelectedIndex; + var idx = this.ListTabs.SelectedIndex; if (((TweenMain)this.Owner).RemoveSpecifiedTab(tb, true)) { this.RefreshListTabs(); idx -= 1; if (idx < 0) idx = 0; - ListTabs.SelectedIndex = idx; + this.ListTabs.SelectedIndex = idx; } } } @@ -1061,7 +1067,7 @@ namespace OpenTween { ((TweenMain)this.Owner).ChangeTabUnreadManage( selectedTab.TabName, - CheckManageRead.Checked); + this.CheckManageRead.Checked); } } @@ -1116,8 +1122,8 @@ namespace OpenTween var selectedTab = this.SelectedTab; if (selectedTab != null) { - selectedTab.Protected = CheckProtected.Checked; - ButtonDeleteTab.Enabled = !CheckProtected.Checked; + selectedTab.Protected = this.CheckProtected.Checked; + this.ButtonDeleteTab.Enabled = !this.CheckProtected.Checked; } } @@ -1126,7 +1132,7 @@ namespace OpenTween var selectedTab = this.SelectedTab; if (selectedTab != null) { - selectedTab.Notify = CheckNotifyNew.Checked; + selectedTab.Notify = this.CheckNotifyNew.Checked; } } @@ -1136,21 +1142,21 @@ namespace OpenTween if (selectedTab != null) { var filename = ""; - if (ComboSound.SelectedIndex > -1) filename = ComboSound.SelectedItem.ToString(); + if (this.ComboSound.SelectedIndex > -1) filename = this.ComboSound.SelectedItem.ToString(); selectedTab.SoundFile = filename; } } private void RadioExAnd_CheckedChanged(object sender, EventArgs e) { - var flg = RadioExAnd.Checked; - ExUID.Enabled = flg; - ExMSG1.Enabled = flg; - ExMSG2.Enabled = !flg; + var flg = this.RadioExAnd.Checked; + this.ExUID.Enabled = flg; + this.ExMSG1.Enabled = flg; + this.ExMSG2.Enabled = !flg; } private void OptMove_CheckedChanged(object sender, EventArgs e) - => this.CheckMark.Enabled = !OptMove.Checked; + => this.CheckMark.Enabled = !this.OptMove.Checked; private void ButtonRuleUp_Click(object sender, EventArgs e) => this.MoveSelectedRules(up: true); @@ -1161,10 +1167,10 @@ namespace OpenTween private void MoveSelectedRules(bool up) { var selectedTab = this.SelectedTab; - if (selectedTab == null || ListFilters.SelectedIndices.Count == 0) + if (selectedTab == null || this.ListFilters.SelectedIndices.Count == 0) return; - var indices = ListFilters.SelectedIndices.Cast().ToArray(); + var indices = this.ListFilters.SelectedIndices.Cast().ToArray(); int diff; if (up) @@ -1174,7 +1180,7 @@ namespace OpenTween } else { - if (indices[indices.Length - 1] >= ListFilters.Items.Count - 1) return; + if (indices[indices.Length - 1] >= this.ListFilters.Items.Count - 1) return; diff = +1; Array.Reverse(indices); // 逆順にして、下にある要素から処理する } @@ -1184,36 +1190,36 @@ namespace OpenTween try { - _multiSelState |= MultiSelectionState.MoveSelected; + this._multiSelState |= MultiSelectionState.MoveSelected; - using (ControlTransaction.Update(ListFilters)) + using (ControlTransaction.Update(this.ListFilters)) { - ListFilters.SelectedIndices.Clear(); + this.ListFilters.SelectedIndices.Clear(); foreach (var idx in indices) { var tidx = idx + diff; - var target = (PostFilterRule)ListFilters.Items[tidx]; + var target = (PostFilterRule)this.ListFilters.Items[tidx]; // 移動先にある要素と位置を入れ替える - ListFilters.Items.RemoveAt(tidx); - ListFilters.Items.Insert(idx, target); + this.ListFilters.Items.RemoveAt(tidx); + this.ListFilters.Items.Insert(idx, target); // 移動方向の先頭要素以外なら選択する if (tidx != lastSelIdx) - ListFilters.SelectedIndex = tidx; + this.ListFilters.SelectedIndex = tidx; } - tab.FilterArray = ListFilters.Items.Cast().ToArray(); + tab.FilterArray = this.ListFilters.Items.Cast().ToArray(); // 移動方向の先頭要素は最後に選択する // ※移動方向への自動スクロール目的 - ListFilters.SelectedIndex = lastSelIdx; + this.ListFilters.SelectedIndex = lastSelIdx; } } finally { - _multiSelState &= ~MultiSelectionState.MoveSelected; + this._multiSelState &= ~MultiSelectionState.MoveSelected; } } @@ -1242,10 +1248,10 @@ namespace OpenTween private void ButtonRuleCopy_Click(object sender, EventArgs e) { var selectedTab = this.SelectedTab; - if (selectedTab != null && ListFilters.SelectedItem != null) + if (selectedTab != null && this.ListFilters.SelectedItem != null) { TabModel[] destinationTabs; - using (var dialog = new TabsDialog(_sts)) + using (var dialog = new TabsDialog(this._sts)) { dialog.MultiSelect = true; dialog.Text = Properties.Resources.ButtonRuleCopy_ClickText1; @@ -1258,7 +1264,7 @@ namespace OpenTween var currentTab = (FilterTabModel)selectedTab; var filters = new List(); - foreach (int idx in ListFilters.SelectedIndices) + foreach (int idx in this.ListFilters.SelectedIndices) { filters.Add(currentTab.FilterArray[idx].Clone()); } @@ -1272,17 +1278,17 @@ namespace OpenTween tb.AddFilter(flt.Clone()); } } - SetFilters(selectedTab); + this.SetFilters(selectedTab); } } private void ButtonRuleMove_Click(object sender, EventArgs e) { var selectedTab = this.SelectedTab; - if (selectedTab != null && ListFilters.SelectedItem != null) + if (selectedTab != null && this.ListFilters.SelectedItem != null) { TabModel[] destinationTabs; - using (var dialog = new TabsDialog(_sts)) + using (var dialog = new TabsDialog(this._sts)) { dialog.MultiSelect = true; dialog.Text = Properties.Resources.ButtonRuleMove_ClickText1; @@ -1294,7 +1300,7 @@ namespace OpenTween var currentTab = (FilterTabModel)selectedTab; var filters = new List(); - foreach (int idx in ListFilters.SelectedIndices) + foreach (int idx in this.ListFilters.SelectedIndices) { filters.Add(currentTab.FilterArray[idx].Clone()); } @@ -1309,15 +1315,15 @@ namespace OpenTween tb.AddFilter(flt.Clone()); } } - for (var idx = ListFilters.Items.Count - 1; idx >= 0; idx--) + for (var idx = this.ListFilters.Items.Count - 1; idx >= 0; idx--) { - if (ListFilters.GetSelected(idx)) + if (this.ListFilters.GetSelected(idx)) { - currentTab.RemoveFilter((PostFilterRule)ListFilters.Items[idx]); - ListFilters.Items.RemoveAt(idx); + currentTab.RemoveFilter((PostFilterRule)this.ListFilters.Items[idx]); + this.ListFilters.Items.RemoveAt(idx); } } - SetFilters(selectedTab); + this.SetFilters(selectedTab); } } @@ -1364,14 +1370,12 @@ namespace OpenTween var tbox = (TextBox)sender; if (e.KeyChar == '@') { - //if (!SettingDialog.UseAtIdSupplement) return; - //@マーク + // @マーク main.ShowSuplDialog(tbox, main.AtIdSupl); e.Handled = true; } else if (e.KeyChar == '#') { - //if (!SettingDialog.UseHashSupplement) return; main.ShowSuplDialog(tbox, main.HashSupl); e.Handled = true; } @@ -1413,7 +1417,7 @@ namespace OpenTween { try { - _multiSelState |= MultiSelectionState.SelectAll; + this._multiSelState |= MultiSelectionState.SelectAll; for (var i = 1; i < itemCount; i++) { @@ -1422,7 +1426,7 @@ namespace OpenTween } finally { - _multiSelState &= ~MultiSelectionState.SelectAll; + this._multiSelState &= ~MultiSelectionState.SelectAll; } }