public void RemoveAt(int index) { if (index >= 0 && index < ItemCount) { PrintItems.RemoveAt(index); OnItemRemoved(new ItemChangedArgs(index)); SaveDefaultQueue(); } }
public void RemoveItem(PrintItemWrapper printItemWrapper) { int index = PrintItems.IndexOf(printItemWrapper); if (index < 0) { // It may be possible to have the same item in the remove list twice. // so if it is not in the PrintItems then ignore it. return; } PrintItems.RemoveAt(index); // and remove it from the data base printItemWrapper.Delete(); }
public void RemoveAt(int index) { if (index >= 0 && index < Count) { bool ActiveItemMustStayInQueue = PrinterConnectionAndCommunication.Instance.PrinterIsPrinting || PrinterConnectionAndCommunication.Instance.PrinterIsPaused; bool PartMustStayInQueue = ActiveItemMustStayInQueue && PrintItems[index] == PrinterConnectionAndCommunication.Instance.ActivePrintItem; if (!PartMustStayInQueue) { PrintItems.RemoveAt(index); OnItemRemoved(new IndexArgs(index)); SaveDefaultQueue(); } } }