Esempio n. 1
0
        /// <summary>
        /// Prints / Resumes print job.
        /// </summary>
        public void Print()
        {
            // print / resume
            _model.Print();

            // update UI
            Update();
        }
        /// <summary>
        /// Prints / Resumes print job.
        /// </summary>
        public void Print()
        {
            // check window
            if (_owner != null)
            {
                _owner.Dispatcher.BeginInvoke(new Action(() =>
                {
                    _owner.Hide();
                }), DispatcherPriority.Background);
            }

            MainController.Singleton.ShowProgressWindow("Sending", "Your document is being sent to the printer. \r\n\r\nPlease make sure the document has been fully printed before you log out.");

            // check the model and chosen printer
            if (_model != null && _model.ChosenPrinter != null)
            {
                // check the settings of the chosen printer
                if (_model.ChosenPrinter.Settings == null)
                {
                    WPFNotifier.Error("Default printer settings will be set");
                    _model.ChosenPrinter.Settings = new System.Drawing.Printing.PrinterSettings()
                    {
                        PrinterName = _model.ChosenPrinter.Name
                    };
                }

                _model.ChosenPrinter.Settings.DefaultPageSettings.Color = PrintWithColor;

                // print / resume
                _model.Print();
            }
            else
            {
                WPFNotifier.Error("Can't print - printer aren't chosen");
            }

            // update UI
            Update();
        }