Example #1
0
        private void GenerateCalibrationPrintJobAsync_Completed(object sender, EventArgs e)
        {
            try
            {
                if (InvokeRequired)
                {
                    Invoke((MethodInvoker) delegate { GenerateCalibrationPrintJobAsync_Completed(sender, e); });
                    return;
                }

                PrinterManager.SelectedPrinters.Remove(this._selectedPrinter);
                PrinterManager.AvailablePrinters.Remove(this._selectedPrinter);
                //SavePrinter.Selected = true;
                this._selectedPrinter.Selected = true;
                PrinterManager.SetDefaultPrinter(this._selectedPrinter);
                this.Enabled = true;
                this.Focus();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message);
            }

            //ProcessActionEnd();
        }
Example #2
0
        public void Test01()
        {
            foreach (String item in PrinterSettings.InstalledPrinters)
            {
                Console.WriteLine(item);
            }

            bool esito = PrinterManager.SetDefaultPrinter(@"\\host\printer");

            Assert.IsTrue(esito);
        }
Example #3
0
        private void RenderJob()
        {
            this.Enabled = false;

            var t = new BackgroundWorker();

            _waitWindowManager = new WaitWindowManager();
            _waitWindowManager.Start(this, t);
            if (t != null)
            {
                t.ReportProgress(0, new WaitWindowUserState(0.01d, "Loading calibration model"));
            }
            Application.DoEvents();

            t.DoWork += new DoWorkEventHandler(RenderJobAsync);

            //load calibration model
            ObjectView.Objects3D.Clear();
            SceneView.UpdateGroundPane(); //ZIE ONDER

            //SavePrinter = PrinterManager.DefaultPrinter;
            this._selectedPrinter.Selected = true;
            PrinterManager.Append((AtumPrinter)(this._selectedPrinter));
            PrinterManager.SetDefaultPrinter((AtumPrinter)this._selectedPrinter);


            BasicCorrectionModel basicCorrection = new BasicCorrectionModel();

            basicCorrection.Open((string)null, false, printerConnectionMaterialTabPanel1.SelectedMaterial.ModelColor, ObjectView.NextObjectIndex, basicCorrection.Triangles);
            basicCorrection.UpdateBoundries();
            basicCorrection.UpdateSelectionboxText();
            if (ObjectView.BindingSupported)
            {
                basicCorrection.BindModel();
            }
            ObjectView.AddModel((object)basicCorrection);
            Application.DoEvents();
            // System.Threading.Thread.Sleep(250);

            //let op hier nog op null printer (initieel) checken

            t.RunWorkerAsync();
        }
Example #4
0
 /// <summary>
 /// Runs the printer setup.
 /// </summary>
 /// <param name="profile">The profile.</param>
 public static void RunPrinterSetup(NetworkProfile profile)
 {
     PrinterManager.SetDefaultPrinter(profile.DefaultPrinter);
 }
 private void cbDefaultPrinter_SelectedIndexChanged(object sender, EventArgs e)
 {
     PrinterManager.SetDefaultPrinter((AtumPrinter)this.cbDefaultPrinter.SelectedItem);
     RefreshMaterials();
 }