Esempio n. 1
0
        public void RemoveSelectedMemosCompletely()
        {
            if (_targetKind != MemoListTargetKind.TrashBox)
            {
                return;
            }

            var selecteds = new MemoInfo[_memoListBox.SelectedItems.Count];

            if (selecteds.Length == 0)
            {
                return;
            }

            if (selecteds.Length > 0)
            {
                for (int i = 0, len = selecteds.Length; i < len; ++i)
                {
                    selecteds[i] = (MemoInfo)_memoListBox.SelectedItems[i];
                }
            }

            if (!MessageUtil.ConfirmMemoRemovalCompletely(selecteds))
            {
                return;
            }

            _memoListBox.BeginUpdate();
            foreach (var item in selecteds)
            {
                var info = (MemoInfo)item;
                _app.RemoveCompletelyMemoFromTrashBox(info);
            }
            _memoListBox.EndUpdate();
        }