Exemplo n.º 1
0
        public Server(Action <string> logger, CancellationToken cancelToken, Configuration config)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            this.logger      = logger;
            this.cancelToken = cancelToken;
            this.config      = config;

            string programFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            this.jobConverter   = new JobConverter(this.logger, programFolder, this.config.OutputFolder);
            this.printJobReader = new PrintJobReader(this.logger, this.cancelToken);
            this.snmpAgent      = new SnmpPrinterAgent(this.logger);
            if (!this.config.VirtualOnly)
            {
                this.postScriptPrinter = new PostScriptPrinter(this.logger, programFolder, this.cancelToken);
                this.conversionKind    = JobConversionKind.PostScript;
            }
            else
            {
                this.conversionKind = JobConversionKind.Pdf;
            }
            this.createJobPropertyMappings();
        }
        public Server(Action<string> logger, CancellationToken cancelToken, Configuration config)
        {
            if(logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            this.logger = logger;
            this.cancelToken = cancelToken;
            this.config = config;

            string programFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            this.jobConverter = new JobConverter(this.logger, programFolder, this.config.OutputFolder);
            this.printJobReader = new PrintJobReader(this.logger, this.cancelToken);
            this.snmpAgent = new SnmpPrinterAgent(this.logger);
            if (!this.config.VirtualOnly)
            {
                this.postScriptPrinter = new PostScriptPrinter(this.logger, programFolder, this.cancelToken);
                this.conversionKind = JobConversionKind.PostScript;
            }
            else
            {
                this.conversionKind = JobConversionKind.Pdf;
            }
            this.createJobPropertyMappings();
        }