void CloneItem() { if (this.lv.SelectedItems.Count > 0) { this.Cursor = Cursors.WaitCursor; try { // this command operates on a single item only; // to avoid ambiguity, use the focused item NgbhItem item = this.GetFocusedItem(); if (item != null) { int itemIndex = this.lv.FocusedItem.Index + 1; NgbhItem item1 = item.Clone(); items.Insert(itemIndex, item1); this.AddItemAt(item1, itemIndex); this.lv.FocusedItem.Focused = false; } } catch (Exception exception1) { this.Cursor = Cursors.Default; Helper.ExceptionMessage(Localization.Manager.GetString("errconvert"), exception1); } this.Cursor = Cursors.Default; } }
void PasteItems(bool asgossip) { int itemIndex = this.NextItemIndex(false); this.Cursor = Cursors.WaitCursor; System.Collections.Queue newq = new Queue(); try { while (clipboard.Count > 0) { NgbhItem item = clipboard.Dequeue() as NgbhItem; newq.Enqueue(item); if (item != null) { item = item.Clone(this.Slot); if (item.IsMemory && item.OwnerInstance > 0 && !asgossip) { item.OwnerInstance = (ushort)items.Parent.SlotID; } if (asgossip) { item.Flags.IsVisible = false; } AddItemAfterSelected(item); } } } catch (Exception exception1) { this.Cursor = Cursors.Default; Helper.ExceptionMessage(Localization.Manager.GetString("errconvert"), exception1); } clipboard.Clear(); clipboard = newq; this.Cursor = Cursors.Default; }