public PrinterViewModel(IPrinterService printerService, IUserInteraction userInteraction) { _printerService = printerService; _userInteraction = userInteraction; EditCustomPrinterSettingsCommand = new CaptionCommand <string>(Resources.Settings, OnEditCustomPrinterSettings, CanEditCustomPrinterSettings); }
public PrinterTemplateViewModel(IPrinterService printerService) { _printerService = printerService; LoadTicketTemplateCommand = new CaptionCommand <string>("", OnLoadTicketTemplate); LoadKitchenOrderTemplateCommand = new CaptionCommand <string>("", OnLoadKitchenOrderTemplate); LoadCustomerReceiptCommand = new CaptionCommand <string>("", OnLoadCustomerReceiptTemplate); }
public PaymentEditorViewModel(IApplicationState applicationState, ITicketService ticketService, IPrinterService printerService, IUserService userService, IAutomationService automationService, TicketTotalsViewModel totals) { _applicationState = applicationState; _ticketService = ticketService; _printerService = printerService; _userService = userService; _automationService = automationService; _manualPrintCommand = new CaptionCommand<PrintJob>(Resources.Print, OnManualPrint, CanManualPrint); _makePaymentCommand = new CaptionCommand<PaymentTemplate>("", OnMakePayment, CanMakePayment); _serviceSelectedCommand = new CaptionCommand<CalculationTemplate>("", OnSelectCalculationTemplate); SubmitAccountPaymentCommand = new CaptionCommand<string>(Resources.AccountBalance_r, OnSubmitAccountPayment, CanSubmitAccountPayment); ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen); TenderAllCommand = new CaptionCommand<string>(Resources.All, OnTenderAllCommand); TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecuted); SetValueCommand = new DelegateCommand<string>(OnSetValue); DivideValueCommand = new DelegateCommand<string>(OnDivideValue); SelectMergedItemCommand = new DelegateCommand<MergedItem>(OnMergedItemSelected); SetDiscountAmountCommand = new CaptionCommand<string>(Resources.Round, OnSetDiscountAmountCommand, CanSetDiscount); AutoSetDiscountAmountCommand = new CaptionCommand<string>(Resources.Flat, OnAutoSetDiscount, CanAutoSetDiscount); SetDiscountRateCommand = new CaptionCommand<string>(Resources.DiscountPercentSign, OnSetDiscountRateCommand, CanSetDiscountRate); MergedItems = new ObservableCollection<MergedItem>(); ReturningAmountVisibility = Visibility.Collapsed; Totals = totals; PaymentButtonGroup = new PaymentButtonGroupViewModel(_makePaymentCommand, null, ClosePaymentScreenCommand); LastTenderedAmount = "1"; }
public BasicReportModule(IRegionManager regionManager, BasicReportView basicReportView, IWorkPeriodService workPeriodService, IPrinterService printerService, ICacheService cacheService, IInventoryService inventoryService, IUserService userService, IAutomationService automationService, IApplicationState applicationState, ILogService logService, ISettingService settingService) : base(regionManager, AppScreens.ReportView) { ReportContext.PrinterService = printerService; ReportContext.WorkPeriodService = workPeriodService; ReportContext.InventoryService = inventoryService; ReportContext.UserService = userService; ReportContext.ApplicationState = applicationState; ReportContext.CacheService = cacheService; ReportContext.LogService = logService; ReportContext.SettingService = settingService; _userService = userService; _regionManager = regionManager; _basicReportView = basicReportView; SetNavigationCommand(Resources.Reports, Resources.Common, "Images/Ppt.png", 60); PermissionRegistry.RegisterPermission(PermissionNames.OpenReports, PermissionCategories.Navigation, Resources.CanDisplayReports); PermissionRegistry.RegisterPermission(PermissionNames.ChangeReportDate, PermissionCategories.Report, Resources.CanChangeReportFilter); //todo refactor automationService.RegisterParameterSource("ReportName", () => ReportContext.Reports.Select(x => x.Header)); }
public BasicReportModule(IRegionManager regionManager, BasicReportView basicReportView, IWorkPeriodService workPeriodService, IPrinterService printerService, IInventoryService inventoryService, IUserService userService, IApplicationState applicationState, IAutomationService automationService, ILogService logService) : base(regionManager, AppScreens.ReportView) { ReportContext.PrinterService = printerService; ReportContext.WorkPeriodService = workPeriodService; ReportContext.InventoryService = inventoryService; ReportContext.UserService = userService; ReportContext.ApplicationState = applicationState; ReportContext.LogService = logService; _userService = userService; _regionManager = regionManager; _basicReportView = basicReportView; SetNavigationCommand(Resources.Reports, Resources.Common, "Images/Ppt.png", 60); PermissionRegistry.RegisterPermission(PermissionNames.OpenReports, PermissionCategories.Navigation, Resources.CanDisplayReports); PermissionRegistry.RegisterPermission(PermissionNames.ChangeReportDate, PermissionCategories.Report, Resources.CanChangeReportFilter); automationService.RegisterActionType("SaveReportToFile", Resources.SaveReportToFile, new { ReportName = "", FileName = "" }); automationService.RegisterActionType(ActionNames.PrintReport, Resources.PrintReport, new { ReportName = "" }); automationService.RegisterParameterSoruce("ReportName", () => ReportContext.Reports.Select(x => x.Header)); EventServiceFactory.EventService.GetEvent<GenericEvent<IActionData>>().Subscribe(x => { if (x.Value.Action.ActionType == "SaveReportToFile") { var reportName = x.Value.GetAsString("ReportName"); var fileName = x.Value.GetAsString("FileName"); if (!string.IsNullOrEmpty(reportName)) { var report = ReportContext.Reports.FirstOrDefault(y => y.Header == reportName); if (report != null) { ReportContext.CurrentWorkPeriod = ReportContext.ApplicationState.CurrentWorkPeriod; var document = report.GetReportDocument(); ReportViewModelBase.SaveAsXps(fileName, document); } } } if (x.Value.Action.ActionType == ActionNames.PrintReport) { var reportName = x.Value.GetAsString("ReportName"); if (!string.IsNullOrEmpty(reportName)) { var report = ReportContext.Reports.FirstOrDefault(y => y.Header == reportName); if (report != null) { ReportContext.CurrentWorkPeriod = ReportContext.ApplicationState.CurrentWorkPeriod; var document = report.GetReportDocument(); ReportContext.PrinterService.PrintReport(document, ReportContext.ApplicationState.CurrentTerminal.ReportPrinter); } } } }); }
public TicketListerWidgetViewModel(Widget model, IApplicationState applicationState, ITicketServiceBase ticketService, IPrinterService printerService, ICacheService cacheService, IAutomationDao automationDao) : base(model, applicationState) { _applicationState = applicationState; _ticketService = ticketService; _printerService = printerService; _cacheService = cacheService; _automationDao = automationDao; ItemSelectionCommand = new DelegateCommand<TicketViewData>(OnItemSelection); EventServiceFactory.EventService.GetEvent<GenericEvent<Message>>().Subscribe( x => { if (_applicationState.ActiveAppScreen == AppScreens.EntityView && x.Topic == EventTopicNames.MessageReceivedEvent && x.Value.Command == Messages.TicketRefreshMessage) { Refresh(); } }); EventServiceFactory.EventService.GetEvent<GenericEvent<WidgetEventData>>().Subscribe( x => { if (x.Value.WidgetName == Name) { State = x.Value.Value; } }); }
public ExecutePrintJob(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IPrinterService printerService) { _ticketService = ticketService; _applicationState = applicationState; _cacheService = cacheService; _printerService = printerService; }
public static AbstractPrintJob CreatePrintJob(Printer printer, IPrinterService printerService) { if (printer.IsTextPrinter) { return(new TextPrinterJob(printer)); } if (printer.IsHtmlPrinter) { return(new HtmlPrinterJob(printer)); } if (printer.IsPortPrinter) { return(new PortPrinterJob(printer)); } if (printer.IsDemoPrinter) { return(new DemoPrinterJob(printer)); } if (printer.IsWindowsPrinter) { return(new WindowsPrinterJob(printer)); } if (printer.IsCustomPrinter) { return(new CustomPrinterJob(printer, printerService)); } if (printer.IsRawPrinter) { return(new RawPrinterJob(printer)); } return(new SlipPrinterJob(printer)); }
public TicketListerWidgetViewModel(Widget model, IApplicationState applicationState, ITicketServiceBase ticketService, IPrinterService printerService, ICacheService cacheService, IAutomationDao automationDao) : base(model, applicationState) { _applicationState = applicationState; _ticketService = ticketService; _printerService = printerService; _cacheService = cacheService; _automationDao = automationDao; ItemSelectionCommand = new DelegateCommand <TicketViewData>(OnItemSelection); EventServiceFactory.EventService.GetEvent <GenericEvent <Message> >().Subscribe( x => { if (_applicationState.ActiveAppScreen == AppScreens.EntityView && x.Topic == EventTopicNames.MessageReceivedEvent && x.Value.Command == Messages.TicketRefreshMessage) { Refresh(); } }); EventServiceFactory.EventService.GetEvent <GenericEvent <WidgetEventData> >().Subscribe( x => { if (x.Value.WidgetName == Name) { State = x.Value.Value; } }); }
public BasicReportModule(IRegionManager regionManager, BasicReportView basicReportView, IWorkPeriodService workPeriodService, IPrinterService printerService, IInventoryService inventoryService, IUserService userService, IApplicationState applicationState, IAutomationService automationService, ILogService logService) : base(regionManager, AppScreens.ReportView) { ReportContext.PrinterService = printerService; ReportContext.WorkPeriodService = workPeriodService; ReportContext.InventoryService = inventoryService; ReportContext.UserService = userService; ReportContext.ApplicationState = applicationState; ReportContext.LogService = logService; _userService = userService; _regionManager = regionManager; _basicReportView = basicReportView; SetNavigationCommand(Resources.Reports, Resources.Common, "Images/Ppt.png", 60); PermissionRegistry.RegisterPermission(PermissionNames.OpenReports, PermissionCategories.Navigation, Resources.CanDisplayReports); PermissionRegistry.RegisterPermission(PermissionNames.ChangeReportDate, PermissionCategories.Report, Resources.CanChangeReportFilter); automationService.RegisterActionType("SaveReportToFile", Resources.SaveReportToFile, new { ReportName = "", FileName = "" }); automationService.RegisterActionType(ActionNames.PrintReport, Resources.PrintReport, new { ReportName = "" }); automationService.RegisterParameterSoruce("ReportName", () => ReportContext.Reports.Select(x => x.Header)); EventServiceFactory.EventService.GetEvent <GenericEvent <ActionData> >().Subscribe(x => { if (x.Value.Action.ActionType == "SaveReportToFile") { var reportName = x.Value.GetAsString("ReportName"); var fileName = x.Value.GetAsString("FileName"); if (!string.IsNullOrEmpty(reportName)) { var report = ReportContext.Reports.FirstOrDefault(y => y.Header == reportName); if (report != null) { ReportContext.CurrentWorkPeriod = ReportContext.ApplicationState.CurrentWorkPeriod; var document = report.GetReportDocument(); ReportViewModelBase.SaveAsXps(fileName, document); } } } if (x.Value.Action.ActionType == ActionNames.PrintReport) { var reportName = x.Value.GetAsString("ReportName"); if (!string.IsNullOrEmpty(reportName)) { var report = ReportContext.Reports.FirstOrDefault(y => y.Header == reportName); if (report != null) { ReportContext.CurrentWorkPeriod = ReportContext.ApplicationState.CurrentWorkPeriod; var document = report.GetReportDocument(); ReportContext.PrinterService.PrintReport(document, ReportContext.ApplicationState.CurrentTerminal.ReportPrinter); } } } }); }
/// <summary> /// The main application entry point. /// </summary> public static void Main() { IPrinterService service = null; try { string location = Assembly.GetExecutingAssembly().Location; FileInfo assemblyFile = new FileInfo(location); if (assemblyFile.Directory == null) { throw new ApplicationException("Unable to determine the location of the running application"); } Directory.SetCurrentDirectory(assemblyFile.Directory.FullName); string logFileDir = Path.Combine(Application.UserAppDataPath, "Logs"); if (!Directory.Exists(logFileDir)) { Directory.CreateDirectory(logFileDir); } GlobalContext.Properties["LogDir"] = logFileDir; XmlConfigurator.Configure(new FileInfo(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)); logger = LogManager.GetLogger(typeof(Program)); /* Initialize and load the composition container for dependency injection */ var aggregateCatalog = new AggregateCatalog(); /* Just look in the executable directory for implementations */ aggregateCatalog.Catalogs.Add(new DirectoryCatalog(AppDomain.CurrentDomain.BaseDirectory)); var container = new CompositionContainer(aggregateCatalog); /* Create the printer inside of the using block (will delete the printer when this block * exits as long as the printer did not already exist). */ service = container.GetExportedValue <IPrinterService>(); RunLoop(service); } catch (Exception ex) { logger.Fatal(ex); } finally { try { if (service != null) { service.Dispose(); } } catch (Exception ex) { logger.Fatal(ex); } } }
public PrinterMapViewModel(PrinterMap model, IMenuService menuService, IPrinterService printerService, ICacheService cacheService) { Model = model; _menuService = menuService; _printerService = printerService; _cacheService = cacheService; }
public TicketListerWidgetCreator(ITicketServiceBase ticketServiceBase, IPrinterService printerService, ICacheService cacheService, IAutomationDao automationDao) { _ticketServiceBase = ticketServiceBase; _printerService = printerService; _cacheService = cacheService; _automationDao = automationDao; }
public PrintAccountTransactionDocument(IAccountService accountService, ICacheService cacheService, IApplicationState applicationState, IPrinterService printerService) { _accountService = accountService; _cacheService = cacheService; _applicationState = applicationState; _printerService = printerService; }
public GenericModemDeviceFactory(IApplicationState applicationState, ICacheService cacheService, IEntityService entityService, IApplicationStateSetter applicationStateSetter, IPrinterService printerService) { this._applicationState = applicationState; this._cacheService = cacheService; this._entityService = entityService; this._applicationStateSetter = applicationStateSetter; this._printerService = printerService; }
protected AbstractCidDevice(string key, string name, ICacheService cacheService, IApplicationState applicationState, IEntityService entityService, IApplicationStateSetter applicationStateSettter, IPrinterService printerService) : base(name, key) { this._cacheService = cacheService; this._applicationState = applicationState; this._entityService = entityService; this._applicationStateSettter = applicationStateSettter; this._printerService = printerService; }
public BrestBTGateway(IPrinterService printerService, IBrestBTClient brestBTClient, IConfigurationProvider configurationProvider) : base(printerService) { _brestBTClient = brestBTClient; _configurationProvider = configurationProvider; }
public AccountTransactionDocumentViewModel(ICacheService cacheService, IPrinterService printerService, IApplicationState applicationState) { _cacheService = cacheService; _printerService = printerService; _applicationState = applicationState; AddItemCommand = new CaptionCommand <string>(string.Format(Resources.Add_f, Resources.Line), OnAddItem); PrintCommand = new CaptionCommand <string>(Resources.Print, OnPrint, CanPrint); }
public PrintJobViewModel(IMenuService menuService, IPrinterService printerService, ICacheService cacheService) { _newPrinterMaps = new List <PrinterMap>(); _menuService = menuService; _printerService = printerService; _cacheService = cacheService; AddPrinterMapCommand = new CaptionCommand <string>(Resources.Add, OnAddPrinterMap); DeletePrinterMapCommand = new CaptionCommand <string>(Resources.Delete, OnDelete, CanDelete); }
public EntityGridWidgetCreator(IEntityService entityService, IUserService userService, ICacheService cacheService, IAutomationDao automationDao, IPrinterService printerService) { _entityService = entityService; _userService = userService; _cacheService = cacheService; _automationDao = automationDao; _printerService = printerService; }
public EntityGridWidgetCreator(IEntityService entityService, IUserService userService, ICacheService cacheService, IAutomationDao automationDao,IPrinterService printerService) { _entityService = entityService; _userService = userService; _cacheService = cacheService; _automationDao = automationDao; _printerService = printerService; }
public VirtualViolationCreateEditViewModel(INavigationManager navigationManager, IViolationService violationService, IVideoService videoService, IPrinterService printerService) : base(navigationManager) { _printerService = printerService; _violationService = violationService; _videoService = videoService; _currentAccount = SessionStorage.Instance.Get <AccountAssociationModel>(StorageConstants.ACCOUNT_ASSOCIATION_KEY); _violation = SessionStorage.Instance.Get <ViolationModel>(StorageConstants.VIOLATION_ITEM_KEY); _video = SessionStorage.Instance.Get <MediaFile>(StorageConstants.VIOLATION_VIDEO_FILE_KEY); _videoId = SessionStorage.Instance.Get <Guid>(StorageConstants.VIDEO_FILE_ID_KEY); _thumbnail = videoService.GetVideoThumbnailFromFile(_video.Path); }
public DocumentCreatorViewModel(IAccountService accountService, ICacheService cacheService, IPrinterService printerService, IApplicationState applicationState) { _accountService = accountService; _cacheService = cacheService; _printerService = printerService; _applicationState = applicationState; SaveCommand = new CaptionCommand<string>(Resources.Save, OnSave); PrintCommand = new CaptionCommand<string>("Print", OnPrint); CancelCommand = new CaptionCommand<string>(Resources.Cancel, OnCancel); EventServiceFactory.EventService.GetEvent<GenericEvent<DocumentCreationData>>().Subscribe(OnDocumentCreation); }
public DocumentCreatorViewModel(IAccountService accountService, ICacheService cacheService, IPrinterService printerService, IApplicationState applicationState) { _accountService = accountService; _cacheService = cacheService; _printerService = printerService; _applicationState = applicationState; SaveCommand = new CaptionCommand <string>(Resources.Save, OnSave); PrintCommand = new CaptionCommand <string>("Print", OnPrint); CancelCommand = new CaptionCommand <string>(Resources.Cancel, OnCancel); EventServiceFactory.EventService.GetEvent <GenericEvent <DocumentCreationData> >().Subscribe(OnDocumentCreation); }
public Export(IPrinterService printerService) { _printerService = printerService; app.HelpOption("-?|-h|--help"); app.OnExecute(() => { _printerService.NodesToCsv(); _printerService.EdgesToCsv(); return(1); }); }
public TicketListViewModel(IApplicationState applicationState, IApplicationStateSetter applicationStateSetter, ITicketService ticketService, IAccountService accountService, IPrinterService printerService, IResourceService locationService, IUserService userService, IAutomationService automationService, ICacheService cacheService, TicketOrdersViewModel ticketOrdersViewModel, TicketTotalsViewModel totals) { _printerService = printerService; _ticketService = ticketService; _accountService = accountService; _locationService = locationService; _userService = userService; _applicationState = applicationState; _applicationStateSetter = applicationStateSetter; _automationService = automationService; _cacheService = cacheService; _ticketOrdersViewModel = ticketOrdersViewModel; _totals = totals; _selectedOrders = new ObservableCollection<Order>(); PrintJobCommand = new CaptionCommand<PrintJob>(Resources.Print, OnPrintJobExecute, CanExecutePrintJob); SelectResourceCommand = new DelegateCommand<ResourceTemplate>(OnSelectResource); AddMenuItemCommand = new DelegateCommand<ScreenMenuItemData>(OnAddMenuItemCommandExecute); CloseTicketCommand = new CaptionCommand<string>(Resources.CloseTicket_r, OnCloseTicketExecute, CanCloseTicket); MakePaymentCommand = new CaptionCommand<string>(Resources.Settle, OnMakePaymentExecute, CanMakePayment); MakeFastPaymentCommand = new CaptionCommand<PaymentTemplate>("[FastPayment]", OnMakeFastPaymentExecute, CanMakeFastPayment); ShowAllOpenTickets = new CaptionCommand<string>(Resources.AllTickets_r, OnShowAllOpenTickets); IncQuantityCommand = new CaptionCommand<string>("+", OnIncQuantityCommand, CanIncQuantity); DecQuantityCommand = new CaptionCommand<string>("-", OnDecQuantityCommand, CanDecQuantity); IncSelectionQuantityCommand = new CaptionCommand<string>("(+)", OnIncSelectionQuantityCommand, CanIncSelectionQuantity); DecSelectionQuantityCommand = new CaptionCommand<string>("(-)", OnDecSelectionQuantityCommand, CanDecSelectionQuantity); ShowTicketTagsCommand = new CaptionCommand<TicketTagGroup>(Resources.Tag, OnShowTicketsTagExecute, CanExecuteShowTicketTags); ShowOrderTagsCommand = new CaptionCommand<OrderTagGroup>(Resources.Tag, OnShowOrderTagsExecute, CanShowOrderTagsExecute); CancelItemCommand = new CaptionCommand<string>(Resources.Cancel, OnCancelItemCommand, CanCancelSelectedItems); MoveOrdersCommand = new CaptionCommand<string>(Resources.MoveTicketLine, OnMoveOrders, CanMoveOrders); EditTicketNoteCommand = new CaptionCommand<string>(Resources.TicketNote, OnEditTicketNote, CanEditTicketNote); RemoveTicketLockCommand = new CaptionCommand<string>(Resources.ReleaseLock, OnRemoveTicketLock, CanRemoveTicketLock); ChangePriceCommand = new CaptionCommand<string>(Resources.ChangePrice, OnChangePrice, CanChangePrice); PaymentButtonGroup = new PaymentButtonGroupViewModel(MakeFastPaymentCommand, MakePaymentCommand, CloseTicketCommand); EventServiceFactory.EventService.GetEvent<GenericEvent<ScreenMenuItemData>>().Subscribe(OnMenuItemSelected); EventServiceFactory.EventService.GetEvent<GenericEvent<OrderViewModel>>().Subscribe(OnSelectedOrdersChanged); EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagData>>().Subscribe(OnTagSelected); EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<Resource>>>().Subscribe(OnAccountSelectedForTicket); EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<ResourceScreenItem>>>().Subscribe(OnResourceScreenItemSelected); EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnRefreshTicket); EventServiceFactory.EventService.GetEvent<GenericEvent<Message>>().Subscribe(OnMessageReceived); EventServiceFactory.EventService.GetEvent<GenericEvent<PopupData>>().Subscribe(OnAccountSelectedFromPopup); EventServiceFactory.EventService.GetEvent<GenericEvent<OrderTagData>>().Subscribe(OnOrderTagEvent); EventServiceFactory.EventService.GetEvent<GenericEvent<MenuItemPortion>>().Subscribe(OnPortionSelected); EventServiceFactory.EventService.GetEvent<GenericIdEvent>().Subscribe(OnTicketIdPublished); }
public BatchDocumentCreatorViewModel(IAccountService accountService, ICacheService cacheService, IPrinterService printerService, IApplicationState applicationState) { Accounts = new ObservableCollection <AccountRowViewModel>(); _accountService = accountService; _cacheService = cacheService; _printerService = printerService; _applicationState = applicationState; CreateDocuments = new CaptionCommand <string>(string.Format(Resources.Create_f, "").Trim(), OnCreateDocuments, CanCreateDocument); GoBack = new CaptionCommand <string>(Resources.Back, OnGoBack); Print = new CaptionCommand <string>(Resources.Print, OnPrint); }
public BatchDocumentCreatorViewModel(IAccountService accountService, ICacheService cacheService, IPrinterService printerService, IApplicationState applicationState) { Accounts = new ObservableCollection<AccountRowViewModel>(); _accountService = accountService; _cacheService = cacheService; _printerService = printerService; _applicationState = applicationState; CreateDocuments = new CaptionCommand<string>(string.Format(Resources.Create_f, "").Trim(), OnCreateDocuments, CanCreateDocument); GoBack = new CaptionCommand<string>(Resources.Back, OnGoBack); Print = new CaptionCommand<string>(Resources.Print, OnPrint); }
public AccountDetailsViewModel(IApplicationState applicationState, ICacheService cacheService, IAccountService accountService, IPrinterService printerService) { _applicationState = applicationState; _cacheService = cacheService; _accountService = accountService; _printerService = printerService; CloseAccountScreenCommand = new CaptionCommand <string>(Resources.Close, OnCloseAccountScreen); DisplayTicketCommand = new CaptionCommand <string>(Resources.FindTicket.Replace(" ", "\r"), OnDisplayTicket); PrintAccountCommand = new CaptionCommand <string>(Resources.Print, OnPrintAccount); AccountDetails = new ObservableCollection <AccountDetailViewModel>(); DocumentTypes = new ObservableCollection <DocumentTypeButtonViewModel>(); AccountSummaries = new ObservableCollection <AccountSummaryViewModel>(); EventServiceFactory.EventService.GetEvent <GenericEvent <EntityOperationRequest <AccountData> > >().Subscribe(OnDisplayAccountTransactions); }
public MusicContractServiceTests() { //setup our DI var serviceProvider = new ServiceCollection() .AddSingleton <IDataContext <MusicContract>, DataContext <MusicContract> >() .AddTransient <IRepository <MusicContract>, MusicContractRepository <MusicContract> >() .AddTransient <IDataContext <DistributionPartnerContract>, DataContext <DistributionPartnerContract> >() .AddTransient <IRepository <DistributionPartnerContract>, DistributionPartnerContractRepository <DistributionPartnerContract> >() .AddTransient <IMusicContractService, MusicContractService>() .AddTransient <IPrinterService <MusicContract>, ConsolePrinterService <MusicContract> >() .BuildServiceProvider(); _musicContractService = serviceProvider.GetService <IMusicContractService>(); _consolePrinterService = serviceProvider.GetService <IPrinterService <MusicContract> >(); }
public AccountDetailsViewModel(IApplicationState applicationState, IAccountService accountService, IPrinterService printerService, ICacheService cacheService) { _applicationState = applicationState; _accountService = accountService; _printerService = printerService; _cacheService = cacheService; CloseAccountScreenCommand = new CaptionCommand<string>(Resources.Close, OnCloseAccountScreen); DisplayTicketCommand = new CaptionCommand<string>(Resources.FindTicket.Replace(" ", "\r"), OnDisplayTicket); PrintAccountCommand = new CaptionCommand<string>(Resources.Print, OnPrintAccount); AccountDetails = new ObservableCollection<AccountDetailViewModel>(); DocumentTypes = new ObservableCollection<DocumentTypeButtonViewModel>(); AccountSummaries = new ObservableCollection<AccountSummaryViewModel>(); EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<AccountData>>>().Subscribe(OnDisplayAccountTransactions); }
public static AbstractPrintJob CreatePrintJob(Printer printer, IPrinterService printerService) { if (printer.IsTextPrinter) return new TextPrinterJob(printer); if (printer.IsHtmlPrinter) return new HtmlPrinterJob(printer); if (printer.IsPortPrinter) return new PortPrinterJob(printer); if (printer.IsDemoPrinter) return new DemoPrinterJob(printer); if (printer.IsWindowsPrinter) return new WindowsPrinterJob(printer); if (printer.IsCustomPrinter) return new CustomPrinterJob(printer, printerService); return new SlipPrinterJob(printer); }
public JobsService(IAppSettings appSettings, ISettingsService settingsService, IFileService fileService, IPrinterService printerService, ILoggerService loggingService) { _settingsService = settingsService; _fileService = fileService; _printerService = printerService; _loggingService = loggingService; _pusherApplicationKey = appSettings.PusherApplicationKey; _printingJobs = new Dictionary <Printer, Job>(); _settingsService.ChannelChangedEvent += _settingsService_ChannelChangedEvent; }
static void Main(string[] args) { var printer = new IPrinterService[] { new InjectPrinter(), new LaserPrinter(), new LedPrinter() }; Console.WriteLine("We have:"); foreach (var p in printer) { p.Print(); } Console.ReadLine(); }
public EntityGridWidgetViewModel(Widget model, IApplicationState applicationState, IPrinterService printerService, IEntityService entityService, IUserService userService, ICacheService cacheService, IAutomationDao automationDao) : base(model, applicationState) { _applicationState = applicationState; _cacheService = cacheService; _automationDao = automationDao; ResourceSelectorViewModel = new EntitySelectorViewModel(applicationState, entityService, userService, cacheService, printerService); EventServiceFactory.EventService.GetEvent<GenericEvent<WidgetEventData>>().Subscribe( x => { if (x.Value.WidgetName == Name) { Settings.StateFilterName = x.Value.Value; Refresh(); } }); }
public ConsoleViewModel( IConsoleService consoleService, ISerialPortService serialPortService, ISettingsService settingsService, IClipboardService clipboardService, IDialogService dialogService, IApplicationServices applicationServices, IWindowService windowService, IPrinterService printerService, ITaskHelpers taskHelpers) { // Services ConsoleService = consoleService; SerialPortService = serialPortService; SettingsService = settingsService; ClipboardService = clipboardService; DialogService = dialogService; ApplicationServices = applicationServices; WindowService = windowService; PrinterService = printerService; TaskHelpers = taskHelpers; // Commands NewSessionCommand = new AsyncRelayCommand(NewSessionCommandImpl); EndSessionCommand = new RelayCommand(EndSessionCommandImpl); SaveCommand = new AsyncRelayCommand(SaveCommandImpl); PrintCommand = new RelayCommand(PrintCommandImpl); ClearCommand = new RelayCommand(ClearCommandImpl); CopyCommand = new RelayCommand(CopyCommandImpl); PasteCommand = new AsyncRelayCommand(PasteCommandImpl); PasteAndSendCommand = new AsyncRelayCommand(PasteAndSendCommandImpl); PasteAndSendLinesCommand = new AsyncRelayCommand(PasteAndSendLinesCommandImpl); CutCommand = new AsyncRelayCommand(CutCommandImpl); SelectAllCommand = new RelayCommand(SelectAllCommandImpl); QuitCommand = new RelayCommand(QuitCommandImpl); SettingsCommand = new RelayCommand(SettingsCommandImpl); Title = "Serial Port Utility"; }
public TicketListerWidgetViewModel(Widget model, IApplicationState applicationState, ITicketServiceBase ticketService, IPrinterService printerService, ISettingService settingService) : base(model, applicationState) { _applicationState = applicationState; _ticketService = ticketService; _printerService = printerService; _settingService = settingService; EventServiceFactory.EventService.GetEvent<GenericEvent<Message>>().Subscribe( x => { if (_applicationState.ActiveAppScreen == AppScreens.EntityView && x.Topic == EventTopicNames.MessageReceivedEvent && x.Value.Command == Messages.TicketRefreshMessage) { Refresh(); } }); }
public TicketListerWidgetViewModel(Widget model, IApplicationState applicationState, ITicketServiceBase ticketService, IPrinterService printerService, ISettingService settingService) : base(model, applicationState) { _applicationState = applicationState; _ticketService = ticketService; _printerService = printerService; _settingService = settingService; EventServiceFactory.EventService.GetEvent <GenericEvent <Message> >().Subscribe( x => { if (_applicationState.ActiveAppScreen == AppScreens.EntityView && x.Topic == EventTopicNames.MessageReceivedEvent && x.Value.Command == Messages.TicketRefreshMessage) { Refresh(); } }); }
public AccountSelectorViewModel(IAccountService accountService, ICacheService cacheService, IApplicationState applicationState, IPrinterService printerService) { _accounts = new ObservableCollection <AccountRowData>(); _accountService = accountService; _cacheService = cacheService; _applicationState = applicationState; _printerService = printerService; ShowAccountDetailsCommand = new CaptionCommand <string>(Resources.AccountDetails.Replace(' ', '\r'), OnShowAccountDetails, CanShowAccountDetails); PrintCommand = new CaptionCommand <string>(Resources.Print, OnPrint); AccountButtonSelectedCommand = new CaptionCommand <AccountScreen>("", OnAccountScreenSelected); EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe( x => { if (x.Topic == EventTopicNames.ResetCache) { _accountButtons = null; _batchDocumentButtons = null; _selectedAccountScreen = null; } }); }
public EntitySelectorViewModel(IApplicationState applicationState, IEntityService entityService, IUserService userService, ICacheService cacheService, IPrinterService printerService) { _applicationState = applicationState; _entityService = entityService; _userService = userService; _cacheService = cacheService; _printerService = printerService; EntitySelectionCommand = new DelegateCommand<EntityScreenItemViewModel>(OnSelectEntityExecuted); IncPageNumberCommand = new CaptionCommand<string>(Resources.NextPage + " >>", OnIncPageNumber, CanIncPageNumber); DecPageNumberCommand = new CaptionCommand<string>("<< " + Resources.PreviousPage, OnDecPageNumber, CanDecPageNumber); EventServiceFactory.EventService.GetEvent<GenericEvent<Message>>().Subscribe( x => { if (_applicationState.ActiveAppScreen == AppScreens.EntityView && x.Topic == EventTopicNames.MessageReceivedEvent && x.Value.Command == Messages.TicketRefreshMessage) { RefreshEntityScreenItems(); } }); }
public EntitySelectorViewModel(IApplicationState applicationState, IEntityService entityService, IUserService userService, ICacheService cacheService, IPrinterService printerService) { _applicationState = applicationState; _entityService = entityService; _userService = userService; _cacheService = cacheService; _printerService = printerService; EntitySelectionCommand = new DelegateCommand <EntityScreenItemViewModel>(OnSelectEntityExecuted); IncPageNumberCommand = new CaptionCommand <string>(Resources.NextPage + " >>", OnIncPageNumber, CanIncPageNumber); DecPageNumberCommand = new CaptionCommand <string>("<< " + Resources.PreviousPage, OnDecPageNumber, CanDecPageNumber); EventServiceFactory.EventService.GetEvent <GenericEvent <Message> >().Subscribe( x => { if (_applicationState.ActiveAppScreen == AppScreens.EntityView && x.Topic == EventTopicNames.MessageReceivedEvent && x.Value.Command == Messages.TicketRefreshMessage) { RefreshEntityScreenItems(); } }); }
public PrintEntity(ICacheService cacheService, IPrinterService printerService,IEntityService entityService) { _cacheService = cacheService; _printerService = printerService; _entityService = entityService; }
public ReportService(IAccountService accountService, IPrinterService printerService, ISettingService settingService) { _accountService = accountService; _printerService = printerService; _settingService = settingService; }
public CustomPrinterJob(Printer printer, IPrinterService printerService) : base(printer) { _printerService = printerService; }
public PrinterController(IPrinterService printerService) { this.printerService = printerService; }
public TicketListerWidgetCreator(ITicketServiceBase ticketServiceBase, IPrinterService printerService, ISettingService settingService) { _ticketServiceBase = ticketServiceBase; _printerService = printerService; _settingService = settingService; }
public MainViewModel(IMessageBoxService servMsgBox, IFileManagerDialogService servFileManager, IProcessStarterService servProcess, IPrinterService servImpr) { ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real" ////} ArchivoActual = new Archivo(); ListaMensajesCompilacion = new ObservableCollection<MensajeCompilacion>(); CommandNew = new RelayCommand(New); CommandOpen = new RelayCommand(Open); CommandSave = new RelayCommand(Save); CommandSaveAs = new RelayCommand(SaveAs); CommandPrint = new RelayCommand(Print); CommandExit = new RelayCommand(Exit); CommandCompilar = new RelayCommand(Compilar); CommandEjecutar = new RelayCommand(Ejecutar); CommandAbrirManual = new RelayCommand(AbrirManual); CommandAboutUs = new RelayCommand(AboutUs); servicioMessageBox = servMsgBox; servicioFileManager = servFileManager; servicioImpresion = servImpr; servicioProcesos = servProcess; compilador = new Compilador(); }
public AccountSelectorViewModel(IAccountService accountService, ICacheService cacheService, IApplicationState applicationState, IPrinterService printerService) { _accounts = new ObservableCollection<AccountRowData>(); _accountService = accountService; _cacheService = cacheService; _applicationState = applicationState; _printerService = printerService; ShowAccountDetailsCommand = new CaptionCommand<string>(Resources.AccountDetails.Replace(' ', '\r'), OnShowAccountDetails, CanShowAccountDetails); PrintCommand = new CaptionCommand<string>(Resources.Print, OnPrint); AccountButtonSelectedCommand = new CaptionCommand<AccountScreen>("", OnAccountScreenSelected); EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe( x => { if (x.Topic == EventTopicNames.ResetCache) { _accountButtons = null; _batchDocumentButtons = null; _selectedAccountScreen = null; } }); }
public FizzBuzzService(IPrinterService printerService) { _printerService = printerService; }