Beispiel #1
0
        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;
            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;
        }
Beispiel #2
0
        private void ShowDetail()
        {
            if (_directAdd)
            {
                return;
            }

            if (ListFilters.SelectedIndex > -1)
            {
                FiltersClass fc = (FiltersClass)ListFilters.SelectedItem;
                if (fc.SearchBoth)
                {
                    RadioAND.Checked  = true;
                    RadioPLUS.Checked = false;
                    UID.Enabled       = true;
                    MSG1.Enabled      = true;
                    MSG2.Enabled      = false;
                    UID.Text          = fc.NameFilter;
                    UID.SelectAll();
                    MSG1.Text = "";
                    MSG2.Text = "";
                    foreach (string bf in fc.BodyFilter)
                    {
                        MSG1.Text += bf + " ";
                    }
                    MSG1.Text = MSG1.Text.Trim();
                    MSG1.SelectAll();
                }
                else
                {
                    RadioPLUS.Checked = true;
                    RadioAND.Checked  = false;
                    UID.Enabled       = false;
                    MSG1.Enabled      = false;
                    MSG2.Enabled      = true;
                    UID.Text          = "";
                    MSG1.Text         = "";
                    MSG2.Text         = "";
                    foreach (string bf in fc.BodyFilter)
                    {
                        MSG2.Text += bf + " ";
                    }
                    MSG2.Text = MSG2.Text.Trim();
                    MSG2.SelectAll();
                }
                TextSource.Text            = fc.Source;
                CheckRegex.Checked         = fc.UseRegex;
                CheckURL.Checked           = fc.SearchUrl;
                CheckCaseSensitive.Checked = fc.CaseSensitive;
                CheckRetweet.Checked       = fc.IsRt;
                CheckLambda.Checked        = fc.UseLambda;

                if (fc.ExSearchBoth)
                {
                    RadioExAnd.Checked  = true;
                    RadioExPLUS.Checked = false;
                    ExUID.Enabled       = true;
                    ExMSG1.Enabled      = true;
                    ExMSG2.Enabled      = false;
                    ExUID.Text          = fc.ExNameFilter;
                    ExUID.SelectAll();
                    ExMSG1.Text = "";
                    ExMSG2.Text = "";
                    foreach (string bf in fc.ExBodyFilter)
                    {
                        ExMSG1.Text += bf + " ";
                    }
                    ExMSG1.Text = ExMSG1.Text.Trim();
                    ExMSG1.SelectAll();
                }
                else
                {
                    RadioExPLUS.Checked = true;
                    RadioExAnd.Checked  = false;
                    ExUID.Enabled       = false;
                    ExMSG1.Enabled      = false;
                    ExMSG2.Enabled      = true;
                    ExUID.Text          = "";
                    ExMSG1.Text         = "";
                    ExMSG2.Text         = "";
                    foreach (string bf in fc.ExBodyFilter)
                    {
                        ExMSG2.Text += bf + " ";
                    }
                    ExMSG2.Text = ExMSG2.Text.Trim();
                    ExMSG2.SelectAll();
                }
                TextExSource.Text            = fc.ExSource;
                CheckExRegex.Checked         = fc.ExUseRegex;
                CheckExURL.Checked           = fc.ExSearchUrl;
                CheckExCaseSensitive.Checked = fc.ExCaseSensitive;
                CheckExRetweet.Checked       = fc.IsExRt;
                CheckExLambDa.Checked        = fc.ExUseLambda;

                if (fc.MoveFrom)
                {
                    OptMove.Checked = true;
                }
                else
                {
                    OptCopy.Checked = true;
                }
                CheckMark.Checked = fc.SetMark;

                ButtonEdit.Enabled     = true;
                ButtonDelete.Enabled   = true;
                ButtonRuleUp.Enabled   = true;
                ButtonRuleDown.Enabled = true;
                ButtonRuleCopy.Enabled = true;
                ButtonRuleMove.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;
            }
        }
Beispiel #3
0
        private void ShowDetail()
        {
            if (_directAdd)
            {
                return;
            }

            if (ListFilters.SelectedIndex > -1)
            {
                PostFilterRule fc = (PostFilterRule)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 = "";
                }
                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();
                }
                TextSource.Text            = fc.FilterSource;
                CheckRegex.Checked         = fc.UseRegex;
                CheckURL.Checked           = fc.FilterByUrl;
                CheckCaseSensitive.Checked = fc.CaseSensitive;
                CheckRetweet.Checked       = fc.FilterRt;
                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 = "";
                }
                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();
                }
                TextExSource.Text            = fc.ExFilterSource;
                CheckExRegex.Checked         = fc.ExUseRegex;
                CheckExURL.Checked           = fc.ExFilterByUrl;
                CheckExCaseSensitive.Checked = fc.ExCaseSensitive;
                CheckExRetweet.Checked       = fc.ExFilterRt;
                CheckExLambDa.Checked        = fc.ExUseLambda;

                if (fc.MoveMatches)
                {
                    OptMove.Checked = true;
                }
                else
                {
                    OptCopy.Checked = true;
                }
                CheckMark.Checked = fc.MarkMatches;

                ButtonEdit.Enabled     = true;
                ButtonDelete.Enabled   = true;
                ButtonRuleUp.Enabled   = true;
                ButtonRuleDown.Enabled = true;
                ButtonRuleCopy.Enabled = true;
                ButtonRuleMove.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;
            }
        }