Beispiel #1
0
        public PrintService(PrintServiceConfig printServiceConfig, ILogger logger)
        {
            IPrintServiceNotificationProvider provider = new PrintServerSingleNotificationProvider(this, this);

            this.factory = new PrintManagerFactory(printServiceConfig, logger, provider);
            this.printResponseDictionary = new ConcurrentDictionary <PrintJobId, PrintResponse>();
        }
        public PrintManagerFactory(PrintServiceConfig printServiceConfig, ILogger logger, IPrintServiceNotificationProvider provider)
        {
            PrintManagerProviderFactory factory = new PrintManagerProviderFactory(printServiceConfig, new PrintManagerChannelFactory(printServiceConfig), provider);
            this.printManagerProviderDictionary = new Dictionary<string, Dictionary<PrintMode, IPrintManagerProvider>>();
            foreach (PrintManagerConfig config in printServiceConfig.PrinterConfig)
            {
                string key = string.Empty;
                switch (config.PrintManagerType)
                {
                    case PrintManagerType.BallyCentralPrintManager:
                        key = "PM";
                        break;

                    default:
                    case PrintManagerType.None:
                        throw new NotSupportedException("config.PrintManagerType not Supported");
                }

                Dictionary<PrintMode, IPrintManagerProvider> printManagerProvider = new Dictionary<PrintMode, IPrintManagerProvider>();
                foreach (var item in Enum.GetValues(typeof(PrintMode)).OfType<PrintMode>())
                {
                    printManagerProvider[item] = factory.GetPrintManager(key, item);
                }

                this.printManagerProviderDictionary[config.Key] = printManagerProvider;
            }

            factory.StartListeners();
        }
Beispiel #3
0
        public PrintManagerFactory(PrintServiceConfig printServiceConfig, ILogger logger, IPrintServiceNotificationProvider provider)
        {
            PrintManagerProviderFactory factory = new PrintManagerProviderFactory(printServiceConfig, new PrintManagerChannelFactory(printServiceConfig), provider);

            this.printManagerProviderDictionary = new Dictionary <string, Dictionary <PrintMode, IPrintManagerProvider> >();
            foreach (PrintManagerConfig config in printServiceConfig.PrinterConfig)
            {
                string key = string.Empty;
                switch (config.PrintManagerType)
                {
                case PrintManagerType.BallyCentralPrintManager:
                    key = "PM";
                    break;

                default:
                case PrintManagerType.None:
                    throw new NotSupportedException("config.PrintManagerType not Supported");
                }

                Dictionary <PrintMode, IPrintManagerProvider> printManagerProvider = new Dictionary <PrintMode, IPrintManagerProvider>();
                foreach (var item in Enum.GetValues(typeof(PrintMode)).OfType <PrintMode>())
                {
                    printManagerProvider[item] = factory.GetPrintManager(key, item);
                }

                this.printManagerProviderDictionary[config.Key] = printManagerProvider;
            }

            factory.StartListeners();
        }
Beispiel #4
0
        internal static IPrintService Create(IConfigService configService, ILogger logger)
        {
            IPrintService      printService       = null;
            PrintServiceConfig printServiceConfig = configService.Get <PrintServiceConfig>("PrintManager", "ServiceConfig", null);

            if (null == printServiceConfig)
            {
                printService = new PrintServiceNull();
                logger.LogDebug("PrintService", "Print Service not configured. All request to print will throw exception");
            }
            else
            {
                printService = new PrintService(printServiceConfig, logger);
            }

            return(printService);
        }
 public PrintManagerProviderFactory(PrintServiceConfig printServiceConfig, PrintManagerChannelFactory factory, IPrintServiceNotificationProvider provider)
 {
     this.factory     = factory;
     this.provider    = provider;
     this.servcieHost = new ServiceHost(new PrintManagerCallback(this.provider), new Uri(printServiceConfig.ListenUri));
 }
 public PrintManagerChannelFactory(PrintServiceConfig printServiceConfig)
 {
     this.printManagerConfigDictionary = printServiceConfig.ChannelConfig.ToDictionary(o => o.Key, StringComparer.OrdinalIgnoreCase);
 }
 public PrintManagerChannelFactory(PrintServiceConfig printServiceConfig)
 {
     this.printManagerConfigDictionary = printServiceConfig.ChannelConfig.ToDictionary(o => o.Key, StringComparer.OrdinalIgnoreCase);
 }
 public PrintManagerProviderFactory(PrintServiceConfig printServiceConfig, PrintManagerChannelFactory factory, IPrintServiceNotificationProvider provider)
 {
     this.factory = factory;
     this.provider = provider;
     this.servcieHost = new ServiceHost(new PrintManagerCallback(this.provider), new Uri(printServiceConfig.ListenUri));
 }
Beispiel #9
0
 public PrintService(PrintServiceConfig printServiceConfig, ILogger logger)
 {
     IPrintServiceNotificationProvider provider = new PrintServerSingleNotificationProvider(this, this);
     this.factory = new PrintManagerFactory(printServiceConfig, logger, provider);
     this.printResponseDictionary = new ConcurrentDictionary<PrintJobId, PrintResponse>();
 }