Exemplo n.º 1
0
 protected override void EnhancedListBox_DragDrop(object sender, DragEventArgs e)
 {
     //external drag drop
     //in future use tracklist clipboard so it doesn't interfer
     //with copy/paste functions
     if (!InternalClipboard.IsEmpty)
     {
         manager.ClearSelection();
         SelectedIndices.Clear();
         PasteFrom(InternalClipboard.Files.ToArray());
         InternalClipboard.Clear();
         Focus();
         Refresh();
         return;
     }
     else
     {
         string[] data = WinFormUtils.GetExternalDragDrop(e);
         if (data == null)
         {
             base.EnhancedListBox_DragDrop(sender, e);
             InternalClipboard.Clear();
         }
         else
         {
             PasteFrom(data);
             InternalClipboard.Clear();
             this.Focus();
             this.Refresh();
             return;
         }
     }
 }
Exemplo n.º 2
0
 public void CopyToInternalClipboard(List <int> list)
 {
     InternalClipboard.Files.Clear();
     foreach (int i in list)
     {
         InternalClipboard.Add(Items[i].Name);
     }
 }
Exemplo n.º 3
0
 protected virtual void TreeViewMS_DragLeave(object sender, EventArgs e)
 {
     if (!InternalClipboard.IsEmpty)
     {
         return;
     }
     InternalClipboard.CopyTree(this);
     //otalClipboard.Files.Reverse();
 }
Exemplo n.º 4
0
 public static void CopyItems(List <ListViewItem> items)
 {
     InternalClipboard.Clear();
     Clipboard.Clear();
     foreach (ListViewItem item in items)
     {
         InternalClipboard.Add(item.SubItems[1].Text);
         Clipboard.SetText(item.SubItems[1].Text);
     }
 }
Exemplo n.º 5
0
 protected override void EnhancedListBox_DragDrop(object sender, DragEventArgs e)
 {
     if (!InternalClipboard.IsEmpty)
     {
         Point        cp         = PointToClient(new Point(e.X, e.Y));
         ListViewItem dragToItem = GetItemAt(cp.X, cp.Y);
         int          dropindex  = manager.ItemCount;
         if (dragToItem != null)
         {
             dropindex = dragToItem.Index;
         }
         manager.AddFiles(dropindex, InternalClipboard.Files.ToArray());
         InternalClipboard.Files.Clear();
         this.Focus();
         return;
     }
     else
     {
         string[] data = WinFormUtils.GetExternalDragDrop(e);
         if (data == null)
         {
             base.EnhancedListBox_DragDrop(sender, e);
             InternalClipboard.Clear();
         }
         else
         {
             foreach (string file in data)
             {
                 Point        cp         = PointToClient(new Point(e.X, e.Y));
                 ListViewItem dragToItem = GetItemAt(cp.X, cp.Y);
                 int          dropindex  = manager.ItemCount;
                 if (dragToItem != null)
                 {
                     dropindex = dragToItem.Index;
                 }
                 VItem i = manager.InsertPlaylistAt(dropindex, file);
                 if (i == null)
                 {
                     continue;
                 }
                 i.Selected = true;
             }
             InternalClipboard.Clear();
             this.Focus();
             this.Refresh();
             return;
         }
     }
 }
Exemplo n.º 6
0
 private void TracklistView_DragLeave(object sender, EventArgs e)
 {
     if (InternalClipboard.IsEmpty)
     {
         if (SelectedItems.Count > 0)
         {
             foreach (int item in SelectedIndices)
             {
                 InternalClipboard.Add(manager.Items[item].Name);
             }
         }
     }
     CacheLastSelectedIndices();
     ShowLastSelected();
 }
Exemplo n.º 7
0
        public static void AddNodes(TreeNode node)
        {
            // tool.Show(t.Tag as string);
            string s = node.Tag as string;

            if (string.IsNullOrEmpty(s))
            {
                return;
            }

            if (Path.HasExtension(s))
            {
                if (File.Exists(s))
                {
                    InternalClipboard.Add(s);
                    return;
                }
            }
            else
            {
                foreach (TreeNode t in node.Nodes)
                {
                    // tool.Show(t.Tag as string);
                    string p = node.Tag as string;
                    if (string.IsNullOrEmpty(p))
                    {
                        continue;
                    }
                    Console.WriteLine(p);
                    if (File.Exists(p) && Path.HasExtension(p))
                    {
                        InternalClipboard.Add(t.Tag as string);
                    }
                    if (t.Nodes.Count > 0)
                    {
                        foreach (TreeNode tn in node.Nodes)
                        {
                            AddNodes(tn);
                        }
                    }
                }
            }
        }