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(); }
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(); }