Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        public static Dictionary <PaperFormat, int> ShowChoosePaperSizesDialog(OrderItem item)
        {
            ChoosePaperSizes dialog;

            if (item != null)
            {
                dialog = new ChoosePaperSizes(item);
            }
            else
            {
                dialog = new ChoosePaperSizes();
            }

            ExecutionEngine.Instance.RegisterModalWidow(dialog);

            dialog.Resources.MergedDictionaries.Add(ExecutionEngine.Instance.Resource);
            dialog.MouseMove += delegate(object mouseMoveSender, MouseEventArgs mouseMoveEventArg)
            {
                ExecutionEngine.Instance.RegisterUserAction();
            };
            dialog.ShowDialog();

            return(dialog.DialogResult.Value ? dialog._orderInfoControl.ResultValues : null);
        }