Пример #1
0
        private static void Main(string[] args)
        {
            var filename = Path.Combine(Paths.SharedDataFolder, "spoolerclientlog.txt");

            Thread.CurrentThread.CurrentCulture = PrinterCompatibleString.PRINTER_CULTURE;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += new ThreadExceptionEventHandler(Program.UIThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Program.CurrentDomain_UnhandledException);
            var num            = 100;
            var spooler_client = new SpoolerClientBuiltIn(new DebugLogger(filename, (uint)num))
            {
                IgnoreConnectingPrinters = false
            };

            if (spooler_client.StartInternalSpoolerSession() == SpoolerResult.Fail_Connect)
            {
                return;
            }

            for (var index = 0; index < args.Length; ++index)
            {
                if (args[index] == "A")
                {
                    MainForm.AUTO_SHUTDOWN_IF_ALL_CLIENTS_DISCONNECT = true;
                }
                else if (args[index] == "H")
                {
                    TrayAppForm.start_invisible = true;
                }
                else if (args[index] == "ZA91L")
                {
                    spooler_client.StayInBootloader = true;
                }
                else if (args[index] == "NIF")
                {
                    spooler_client.CHECK_INCOMPATIBLE_FIRMWARE = false;
                }
                else if (args[index] == "NOGAN")
                {
                    spooler_client.CHECK_GANTRY_CLIPS = false;
                }
                else if (args[index] == "NOBED")
                {
                    spooler_client.CHECK_BED_CALIBRATION = false;
                }
                else if (args[index] == "AUTO")
                {
                    spooler_client.AUTO_UPDATE_FIRMWARE = true;
                }
            }
            spooler_client.CheckFirmware = true;
            Application.Run(new TrayAppForm(spooler_client));
        }
Пример #2
0
 public TrayAppForm(SpoolerClientBuiltIn spooler_client)
     : base(spooler_client)
 {
     trayMenu = new ContextMenu();
     trayMenu.MenuItems.Add("Exit", new EventHandler(OnExit));
     trayIcon = new NotifyIcon
     {
         Text        = "M3D Spooler",
         Icon        = new Icon(Resources.M3D, 40, 40),
         ContextMenu = trayMenu,
         Visible     = true
     };
     TopLevel        = true;
     trayIcon.Click += new EventHandler(NotifyIcon1_Click);
 }
Пример #3
0
 public SpoolerMessageHandler(SpoolerClientBuiltIn spooler_client)
 {
     threadsync          = new object();
     this.spooler_client = spooler_client;
     queued_messages     = new Queue <SpoolerMessage>();
 }