コード例 #1
0
 void rbKeyword_Click(object sender, EventArgs e)
 {
     if (KeywordsDialog.ShowDialog(SearchSettings.Instance.KeywordsSettings) == DialogResult.OK)
     {
         UpdateKeywordsCaption();
     }
 }
コード例 #2
0
ファイル: SearchPlugin.cs プロジェクト: xhqiao89/HydroDesktop
        void rbKeyword_Click(object sender, EventArgs e)
        {
            if (!ReadSelectedKeywords())
            {
                return;
            }
            if (KeywordsDialog.ShowDialog(_searchSettings.KeywordsSettings) == DialogResult.OK)
            {
                var selectedKeywords = _searchSettings.KeywordsSettings.SelectedKeywords.ToList();
                if (selectedKeywords.Count > 1)
                {
                    _dropdownKeywords.MultiSelect = true;

                    // This code has no other purpose than to  immediately trigger the text to change to Multiple Selected.
                    // Without it, you have to hover or click on something in the ribbon for the change to occur.

                    _dropdownKeywords.Enabled = false;
                    _dropdownKeywords.Enabled = true;
                }
                else if (selectedKeywords.Count == 1)
                {
                    _dropdownKeywords.MultiSelect  = false;
                    _dropdownKeywords.SelectedItem = selectedKeywords[0];
                }
                else
                {
                    _dropdownKeywords.MultiSelect  = false;
                    _dropdownKeywords.SelectedItem = null;
                }

                UpdateKeywordsCaption();

                // MultiSelect = false;
            }
        }