/// <summary>
 /// 按钮 确定
 /// </summary>
 private void BtnOK_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(TextBoxInputValue.Text))
     {
         SingleTextInputEventArgs args = new SingleTextInputEventArgs();
         args.Add(TextBoxInputValue.Text);
         InputResultEvent(this, args);
     }
     Close_Click(sender, e);
 }
Пример #2
0
        /// <summary>
        /// 添加收藏目录、暂时添加到Combox中、添加关键词时才会真正创建到收藏列表
        /// </summary>
        private void AddFavDirToCombBox(object sender, SingleTextInputEventArgs args)
        {
            string favDirName = args.ToStringArray()[0];

            if (string.IsNullOrWhiteSpace(favDirName))
            {
                return;
            }

            if (!DirItems.Any(n => n == favDirName))
            {
                DirItems.Add(favDirName);
                MainWindow.MainW.Toast.Show($"新建 {favDirName} 收藏目录完成", MsgType.Success);
            }
            else
            {
                MainWindow.MainW.Toast.Show($"已存在同名收藏目录 {favDirName}", MsgType.Warning);
            }
            ComboBoxFavDir.SelectedItem = favDirName;
        }