Exemple #1
0
        /// <summary>
        /// 隐藏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnCollapsed_OnClick(object sender, RoutedEventArgs e)
        {
            //保存所有便签设置
            NotepadManage.SaveSetings();


            if (ListBox1.SelectedItem == null)
            {
                return;
            }
            var model = (ListBoxItemM)ListBox1.SelectedItem;

            //如果现状态为显示
            if (state == NotepadState.Visible)
            {
                var v = NotepadManage.WindowList.Find(m => m.CacheFileName == RichTextBoxTool.PathCacheVisible + model.Name);
                v?.Close();

                //移动
                Move(_selectedPath + model.Name, RichTextBoxTool.PathCacheHidden + model.Name);

                BingListBox1();
            }

            //如果已经删除状态,则直接物理删除
            if (state == NotepadState.Delete)
            {
                //移动
                Move(_selectedPath + model.Name, RichTextBoxTool.PathCacheHidden + model.Name);

                BingListBox1();
                return;
            }
        }