Exemple #1
0
        /// <summary>
        /// Create main window form
        /// </summary>
        public mainWin()
        {
            Printers.init();
            tools.SetAllowUnsafeHeaderParsing20();

            log.Info("GUI Initialization start...");
            InitializeComponent();

            log.Info("Loading config start...");
            Program.config = new Config(err =>
            {
                log.Error(err, "Config loading error.");
            });

            log.Info("Cheking update...");
            updateInit();

            log.Info("Tray icon initialization...");
            trayIconInit();

            log.Info("Configuring GUI...");
            aboutTabInit();

            this.Shown += mainWin_Shown;
            WinAutoSize.apply(this, new Control[] { printersTable, jobsTable.table });
        }
Exemple #2
0
        public static void init()
        {
            Printers.init();
            log.Info("Loading config start...");
            Program.config = new Config(err =>
            {
                log.Error(err, "Config loading error.");
            });

            //pingPongPipe();
            //printers();
            //jobsList();
            //jobPrint();
            //ConfigReload();
            //JobsServerState();

            server = new NamedPipeServer <string>(Pipe.name);
            server.ClientConnected    += server_ClientConnected;
            server.ClientMessage      += server_ClientMessage;
            server.ClientDisconnected += server_ClientDisconnected;
            server.Error += server_Error;
            server.Start();

            if (Program.config.channel.Length != 0)
            {
                srvConnect(Program.config.channel);
            }

            msgTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            msgTimer.Interval = 100;
            msgTimer.Enabled  = true;

            configWatch();
        }