private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { // Put the records in the clipboard into the active MDI child CollectionForm activeChild = (CollectionForm)ActiveMdiChild; activeChild.collection.AddRange(fromClipboard()); activeChild.RefreshFilteredItems(); }
private void newCollectionWindow(Collection collection) { CollectionForm cf = new CollectionForm(collection); cf.MdiParent = this; if (MdiChildren.Length == 1) { cf.WindowState = FormWindowState.Maximized; } cf.Show(); }
private void cutToolStripMenuItem_Click(object sender, EventArgs e) { // Get the selected records CollectionForm activeChild = (CollectionForm)ActiveMdiChild; List <Media> records = activeChild.getSelectedItems(); // Put the data into the clipboard toClipboard(records); // Since this is a cut, remove the selected records activeChild.collection.RemoveRange(records); activeChild.RefreshFilteredItems(); }
private int getActiveCollectionIndex() { //Get the index of the active collection window CollectionForm cf = (CollectionForm)ActiveMdiChild; for (int i = 0; i < collections.Count; i++) { if (collections[i].Item == cf.collection) { return(i); } } throw new IndexOutOfRangeException("Failed to look up index of MDI child form."); }
private void newCollectionWindow(Collection collection) { CollectionForm cf = new CollectionForm(collection); cf.MdiParent = this; if (MdiChildren.Length == 1) cf.WindowState = FormWindowState.Maximized; cf.Show(); }