private void ShowChooseFormatsWindow() { if (ChoosePaperSizes.ShowChoosePaperSizesDialog(Order) == null) { return; } if (_hostList == null) { throw new System.ArgumentNullException("_hostList"); } if (Order.IsEmpty()) { RemoveItem(false); } else { if (!_hostList.LastAppliedFilter.Includes(this)) { RemoveItem(true); } } OnContentChangedEvent(EventArgs.Empty); }
private void SetFormatForAllItems(object sender, RoutedEventArgs e) { CheckDisposedState(); Dictionary <PaperFormat, int> paperSizeCounts = ChoosePaperSizes.ShowChoosePaperSizesDialog(null); if (paperSizeCounts != null && ExecutionEngine.Context.Contains(Constants.OrderContextName)) { Order currentOrder = (Order)ExecutionEngine.Context[Constants.OrderContextName]; foreach (OrderItem orderItem in currentOrder.OrderItems) { foreach (PaperFormat format in ExecutionEngine.Instance.PaperFormats) { if (paperSizeCounts[format] == 0) { orderItem.ClearCrop(format); } else if (orderItem.GetCount(format) == 0) { orderItem.SetCrop(format); } orderItem.SetCount(format, paperSizeCounts[format]); } orderItem.UpdateImprintsCountText(); } if (currentOrder.OrderItems[0].IsEmpty()) { foreach (ThumbnailItem item in _listControl.List.Items) { item.Checked = false; } currentOrder.OrderItems.Clear(); _listControl.List.ClearAll(); _stage.ShowSelectScreen(); } _orderInfoControl.Update(); _listControl.UpdateFilterControls(); } }