Пример #1
0
        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if ((CurrentArchive != null) && (listView1.SelectedItems.Count > 0) && NotInDebugger())
            {
                ReleaseCutItems();

                ShellFileGroup _files = new ShellFileGroup();

                foreach (ListViewItem _item in listView1.SelectedItems)
                {
                    EQArchiveFile _file = (EQArchiveFile)_item.Tag;

                    _files.Add(_file.Filename, _file.GetContents());
                }

                Clipboard.SetDataObject(_files.GetDataObject(DragDropEffects.Copy));

                CheckClipboard();
            }
        }
Пример #2
0
        private void cutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if ((CurrentArchive != null) && (listView1.SelectedItems.Count > 0) && NotInDebugger())
            {
                ReleaseCutItems();

                ShellFileGroup _files = new ShellFileGroup();
                ItemsCutToClipboard = new ListViewItem[listView1.SelectedItems.Count];
                listView1.SelectedItems.CopyTo(ItemsCutToClipboard, 0);

                foreach (ListViewItem _item in ItemsCutToClipboard)
                {
                    EQArchiveFile _file = (EQArchiveFile)_item.Tag;

                    _files.Add(_file.Filename, _file.GetContents());

                    _item.ForeColor = SystemColors.GrayText;
                }

                _files.ActionCompleted += clipboardOperation_Complete;

                Clipboard.SetDataObject(_files.GetDataObject(DragDropEffects.Move));

                CheckClipboard();
            }
        }
Пример #3
0
        private void listView1_ItemDrag(object sender, ItemDragEventArgs e)
        {
            if (NotInDebugger())
            {
                ShellFileGroup _files = new ShellFileGroup();

                foreach (ListViewItem _item in listView1.SelectedItems)
                {
                    EQArchiveFile _file = ((EQArchiveFile)_item.Tag).AsFormat(Settings.ExportFormat, true);

                    _files.Add(_file.Filename, _file.GetContents());
                }

                listView1.DoDragDrop(_files.GetDataObject(DragDropEffects.Copy), DragDropEffects.Copy);
            }
        }