Exemplo n.º 1
0
        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 WarehouseInventoryViewModel(IInventoryService inventoryService, ICacheService cacheService, IApplicationState applicationState)
 {
     _inventoryService = inventoryService;
     _cacheService = cacheService;
     _applicationState = applicationState;
     WarehouseButtonSelectedCommand = new CaptionCommand<Warehouse>("", OnWarehouseSelected);
 }
Exemplo n.º 3
0
 public ExecutePrintJob(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IPrinterService printerService)
 {
     _ticketService = ticketService;
     _applicationState = applicationState;
     _cacheService = cacheService;
     _printerService = printerService;
 }
Exemplo n.º 4
0
        public EditorView(IApplicationState state)
        {
            InitializeComponent();

            _state = state;

            _editor = new TextEditor();
            _editor.Name = "txtEditor";
            _editor.IsReadOnly = true;
            _editor.Options.EnableEmailHyperlinks = false;
            _editor.Options.EnableHyperlinks = false;
            _editor.TextChanged += OnTextChanged;

            ehoEditor.Child = _editor;

            // folding
            var foldingManager = FoldingManager.Install(_editor.TextArea);
            var foldingStrategy = new GherkinFoldingStrategy();
            Timer foldingTimer = new Timer { Interval = TimeSpan.FromSeconds(2).Seconds };
            foldingTimer.Tick += (s, e) => foldingStrategy.UpdateFoldings(foldingManager, _editor.Document);
            foldingTimer.Start();

            // code completion
            var codeCompletionStrategy = new GherkinCodeCompletionStrategy(_editor, state);

            state.Project.CurrentFeatureChanged += OnCurrentFeatureChanged;
            state.Settings.EditorSettingsChanged += OnEditorSettingsChanged;
        }
Exemplo n.º 5
0
        public AccountModule(IRegionManager regionManager,
            IUserService userService, IApplicationState applicationState,
            AccountSelectorView accountSelectorView, AccountSelectorViewModel accountSelectorViewModel,
            AccountDetailsView accountDetailsView,
            DocumentCreatorView documentCreatorView,
            BatchDocumentCreatorView batchDocumentCreatorView, BatchDocumentCreatorViewModel batchDocumentCreatorViewModel)
            : base(regionManager, AppScreens.AccountView)
        {
            _regionManager = regionManager;
            _userService = userService;
            _applicationState = applicationState;
            _accountSelectorView = accountSelectorView;
            _accountSelectorViewModel = accountSelectorViewModel;
            _accountDetailsView = accountDetailsView;
            _documentCreatorView = documentCreatorView;
            _batchDocumentCreatorView = batchDocumentCreatorView;
            _batchDocumentCreatorViewModel = batchDocumentCreatorViewModel;

            AddDashboardCommand<EntityCollectionViewModelBase<AccountTypeViewModel, AccountType>>(Resources.AccountType.ToPlural(), Resources.Accounts, 40);
            AddDashboardCommand<EntityCollectionViewModelBase<AccountViewModel, Account>>(Resources.Account.ToPlural(), Resources.Accounts, 40);
            AddDashboardCommand<EntityCollectionViewModelBase<AccountScreenViewModel, AccountScreen>>(Resources.AccountScreen.ToPlural(), Resources.Accounts, 40);
            AddDashboardCommand<EntityCollectionViewModelBase<AccountTransactionTypeViewModel, AccountTransactionType>>(Resources.TransactionType.ToPlural(), Resources.Accounts, 40);
            AddDashboardCommand<EntityCollectionViewModelBase<AccountTransactionDocumentTypeViewModel, AccountTransactionDocumentType>>(Resources.DocumentType.ToPlural(), Resources.Accounts, 40);
            AddDashboardCommand<EntityCollectionViewModelBase<AccountTransactionDocumentViewModel, AccountTransactionDocument>>(Resources.Transaction.ToPlural(), Resources.Accounts, 40);

            PermissionRegistry.RegisterPermission(PermissionNames.NavigateAccountView, PermissionCategories.Navigation, Resources.CanNavigateCash);
            PermissionRegistry.RegisterPermission(PermissionNames.CreateAccount, PermissionCategories.Account, Resources.CanCreateAccount);

            SetNavigationCommand(Resources.Accounts, Resources.Common, "Images/Xls.png", 30);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the SearchTabViewModel class.
 /// </summary>
 /// <param name="applicationState">Application state</param>
 /// <param name="movieService">Movie service</param>
 /// <param name="movieHistoryService">Movie history service</param>
 public SearchTabViewModel(IApplicationState applicationState, IMovieService movieService, IMovieHistoryService movieHistoryService)
     : base(applicationState, movieService, movieHistoryService)
 {
     RegisterMessages();
     RegisterCommands();
     TabName = LocalizationProviderHelper.GetLocalizedValue<string>("SearchTitleTab");
 }
 public DepartmentSelectorView(IApplicationStateSetter applicationStateSetter, IApplicationState applicationState,
     IUserService userService, ICacheService cacheService)
 {
     InitializeComponent();
     _applicationStateSetter = applicationStateSetter;
     DataContext = new DepartmentSelectorViewModel(applicationState, _applicationStateSetter, userService, cacheService);
 }
        public MenuItemSelectorViewModel(IApplicationState applicationState, IApplicationStateSetter applicationStateSetter, IMenuService menuService,
            ISettingService settingService, ICacheService cacheService)
        {
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _menuService = menuService;
            _settingService = settingService;
            _cacheService = cacheService;

            CategoryCommand = new DelegateCommand<ScreenMenuCategory>(OnCategoryCommandExecute);
            MenuItemCommand = new DelegateCommand<ScreenMenuItem>(OnMenuItemCommandExecute);
            TypeValueCommand = new DelegateCommand<string>(OnTypeValueExecute);
            FindLocationCommand = new DelegateCommand<string>(OnFindLocationExecute, CanFindLocation);
            FindMenuItemCommand = new DelegateCommand<string>(OnFindMenuItemCommand);
            FindTicketCommand = new DelegateCommand<string>(OnFindTicketExecute, CanFindTicket);
            IncPageNumberCommand = new CaptionCommand<string>(Localization.Properties.Resources.NextPage + " >>", OnIncPageNumber, CanIncPageNumber);
            DecPageNumberCommand = new CaptionCommand<string>("<< " + Localization.Properties.Resources.PreviousPage, OnDecPageNumber, CanDecPageNumber);
            SubCategoryCommand = new CaptionCommand<ScreenSubCategoryButton>(".", OnSubCategoryCommand);

            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(OnDepartmentChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnNumeratorReset);
            NumeratorValue = "";

            SubCategories = new ObservableCollection<ScreenSubCategoryButton>();
        }
 public DepartmentButtonViewModel(DepartmentSelectorViewModel parentViewModel,
     IApplicationState applicationState)
 {
     _parentViewModel = parentViewModel;
     _applicationState = applicationState;
     DepartmentSelectionCommand = new CaptionCommand<string>("Select", OnSelectDepartment);
 }
Exemplo n.º 10
0
 public TicketTagListViewModel(IApplicationState applicationState)
 {
     _applicationState = applicationState;
     SelectionCommand = new DelegateCommand<TicketTagGroup>(OnSelectTicketTagGroup);
     CloseCommand = new CaptionCommand<string>(Resources.Close, OnClose);
     TicketTagValueViewModels = new ObservableCollection<TicketTagValueViewModel>();
 }
Exemplo n.º 11
0
        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));

        }
Exemplo n.º 12
0
        public LoggedInUserViewModel(IApplicationState applicationState, IUserService userService)
        {
            _userService = userService;
            _applicationState = applicationState;

            EventServiceFactory.EventService.GetEvent<GenericEvent<User>>().Subscribe(x =>
            {
                if (x.Topic == EventTopicNames.UserLoggedIn) UserLoggedIn(x.Value);
                if (x.Topic == EventTopicNames.UserLoggedOut) UserLoggedOut(x.Value);
            });

            LoggedInUser = applicationState.CurrentLoggedInUser;

            LogoutUserCommand = new DelegateCommand<User>(x =>
            {
                if (!_applicationState.IsLocked)
                {
                    if (_userService.IsUserPermittedFor(PermissionNames.OpenNavigation))
                    {
                        EventServiceFactory.EventService.PublishEvent(EventTopicNames.ActivateNavigation);
                    }
                    else
                    {
                        _userService.LogoutUser();
                    }
                }
            });
        }
 public AutomationCommandSelectorViewModel(IApplicationState applicationState, IExpressionService expressionService)
 {
     _applicationState = applicationState;
     _expressionService = expressionService;
     SelectAutomationCommand = new DelegateCommand<AutomationCommandData>(OnSelectAutomationCommand, CanSelectAutomationCommand);
     CloseCommand = new CaptionCommand<string>(Resources.Close, OnCloseCommandExecuted);
 }
Exemplo n.º 14
0
        public PosViewModel(IRegionManager regionManager, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
            ITicketService ticketService, IUserService userService, ICacheService cacheService, TicketListViewModel ticketListViewModel,
            TicketTagListViewModel ticketTagListViewModel, MenuItemSelectorViewModel menuItemSelectorViewModel, MenuItemSelectorView menuItemSelectorView,
            TicketViewModel ticketViewModel, TicketOrdersViewModel ticketOrdersViewModel,TicketEntityListViewModel ticketEntityListViewModel)
        {
            _ticketService = ticketService;
            _userService = userService;
            _cacheService = cacheService;
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _regionManager = regionManager;
            _menuItemSelectorView = menuItemSelectorView;
            _ticketViewModel = ticketViewModel;
            _ticketOrdersViewModel = ticketOrdersViewModel;
            _menuItemSelectorViewModel = menuItemSelectorViewModel;
            _ticketListViewModel = ticketListViewModel;
            _ticketTagListViewModel = ticketTagListViewModel;
            _ticketEntityListViewModel = ticketEntityListViewModel;

            EventServiceFactory.EventService.GetEvent<GenericEvent<Ticket>>().Subscribe(OnTicketEventReceived);
            EventServiceFactory.EventService.GetEvent<GenericEvent<SelectedOrdersData>>().Subscribe(OnSelectedOrdersChanged);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(OnTicketEvent);
            EventServiceFactory.EventService.GetEvent<GenericEvent<ScreenMenuItemData>>().Subscribe(OnMenuItemSelected);
            EventServiceFactory.EventService.GetEvent<GenericIdEvent>().Subscribe(OnTicketIdPublished);
            EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<Entity>>>().Subscribe(OnEntitySelectedForTicket);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagGroup>>().Subscribe(OnTicketTagSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketStateData>>().Subscribe(OnTicketStateSelected);
            EventServiceFactory.EventService.GetEvent<GenericEvent<Department>>().Subscribe(OnDepartmentChanged);
        }
Exemplo n.º 15
0
        public PaymentEditorViewModel(IApplicationState applicationState, ICacheService cacheService, IExpressionService expressionService,
            TicketTotalsViewModel paymentTotals, PaymentEditor paymentEditor, NumberPadViewModel numberPadViewModel,
            OrderSelectorViewModel orderSelectorViewModel, ITicketService ticketService,
            ForeignCurrencyButtonsViewModel foreignCurrencyButtonsViewModel, PaymentButtonsViewModel paymentButtonsViewModel,
            CommandButtonsViewModel commandButtonsViewModel, TenderedValueViewModel tenderedValueViewModel,
            ReturningAmountViewModel returningAmountViewModel, ChangeTemplatesViewModel changeTemplatesViewModel, AccountBalances accountBalances)
        {
            _applicationState = applicationState;
            _cacheService = cacheService;
            _expressionService = expressionService;
            _paymentTotals = paymentTotals;
            _paymentEditor = paymentEditor;
            _numberPadViewModel = numberPadViewModel;
            _orderSelectorViewModel = orderSelectorViewModel;
            _ticketService = ticketService;
            _foreignCurrencyButtonsViewModel = foreignCurrencyButtonsViewModel;
            _commandButtonsViewModel = commandButtonsViewModel;
            _tenderedValueViewModel = tenderedValueViewModel;
            _returningAmountViewModel = returningAmountViewModel;
            _changeTemplatesViewModel = changeTemplatesViewModel;
            _accountBalances = accountBalances;

            _makePaymentCommand = new CaptionCommand<PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand<PaymentData>("", OnSelectChangePaymentType);

            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            paymentButtonsViewModel.SetButtonCommands(_makePaymentCommand, null, ClosePaymentScreenCommand);
        }
Exemplo n.º 16
0
        public MenuViewModel(IApplicationState state, IPluginManager pluginManager, IApplicationConfig config, IPresetsManager presetManager)
        {
            _pluginManager = pluginManager;
            _state = state;
            _config = config;
            _presetsManager = presetManager;

            //Commands
            _openCommand = new DelegateCommand(Open);
            _openFileCommand = new DelegateCommand(OpenFile);
            _openStreamCommand = new DelegateCommand(OpenStream);
            _openDiscCommand = new DelegateCommand(OpenDisc);
            _openDeviceCommand = new DelegateCommand(OpenDevice);
            _openProcessCommand = new DelegateCommand(OpenProcess);
            _browseSamplesCommand = new DelegateCommand(BrowseSamples);
            _exitCommand = new DelegateCommand(Exit);
            _changeFormatCommand = new DelegateCommand(SetStereoInput);
            _changeProjectionCommand = new DelegateCommand(SetProjection);
            _changeEffectCommand = new DelegateCommand(SetEffect);
            _changeLayoutCommand = new DelegateCommand(SetStereoOutput);
            _changeDistortionCommand = new DelegateCommand(SetDistortion);
            _changeTrackerCommand = new DelegateCommand(SetTracker);
            _saveMediaPresetCommand = new DelegateCommand(SaveMediaPreset);
            _saveDevicePresetCommand = new DelegateCommand(SaveDevicePreset);
            _saveAllPresetCommand = new DelegateCommand(SaveAllPreset);
            _loadMediaPresetCommand = new DelegateCommand(LoadMediaPreset);
            _resetPresetCommand = new DelegateCommand(ResetPreset);
            _settingsCommand = new DelegateCommand(ShowSettings);
            _launchWebBrowserCommand = new DelegateCommand(LaunchWebBrowser);
            _aboutCommand = new DelegateCommand(ShowAbout);
        }
Exemplo n.º 17
0
 public WorkPeriodService(IWorkPeriodDao workPeriodDao, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter, ILogService logService)
 {
     _workPeriodDao = workPeriodDao;
     _applicationState = applicationState;
     _applicationStateSetter = applicationStateSetter;
     _logService = logService;
 }
Exemplo n.º 18
0
 public void PushState(IApplicationState newState)
 {
     appStates.Peek().OnDisable();
     newState.App = this;
     appStates.Push(newState);
     newState.OnEnable();
 }
Exemplo n.º 19
0
        public UpdateManager(
            IApplicationState applicationState,
            IApplicationWindowState applicationWindowState,
            IUserActivityMonitor userActivityMonitor,
            IUpdateCheckerFactory updateCheckerFactory,
            IProcessStartProvider processStartProvider,
            IUpdatePromptProvider updatePromptProvider,
            Func<IUpdateVariantHandler> updateVariantHandlerFactory)
        {
            this.applicationState = applicationState;
            this.applicationWindowState = applicationWindowState;
            this.userActivityMonitor = userActivityMonitor;
            this.updateCheckerFactory = updateCheckerFactory;
            this.processStartProvider = processStartProvider;
            this.updatePromptProvider = updatePromptProvider;
            this.updateVariantHandlerFactory = updateVariantHandlerFactory;

            this.promptTimer = new DispatcherTimer();
            this.promptTimer.Tick += this.PromptTimerElapsed;

            // Strategy time:
            // We'll prompt the user a fixed period after the computer starts up / resumes from sleep
            // We'll also check on a fixed interval since this point
            // We'll also check when the application is restored from tray

            this.applicationState.Startup += this.ApplicationStartup;
            this.applicationState.ResumeFromSleep += this.ResumeFromSleep;
            this.applicationWindowState.RootWindowActivated += this.RootWindowActivated;
        }
        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;
                }
            });
        }
Exemplo n.º 21
0
 public ReturningAmountViewModel(ICacheService cacheService, IApplicationState applicationState,
      PaymentEditor paymentEditor)
 {
     _cacheService = cacheService;
     _applicationState = applicationState;
     _paymentEditor = paymentEditor;
 }
Exemplo n.º 22
0
 public ChangeTicketEntity(ITicketService ticketService, IApplicationState applicationState, ICacheService cacheService, IEntityService entityService)
 {
     _ticketService = ticketService;
     _applicationState = applicationState;
     _cacheService = cacheService;
     _entityService = entityService;
 }
Exemplo n.º 23
0
        public UpdateManager(
            IApplicationState applicationState,
            IApplicationWindowState applicationWindowState,
            IUserActivityMonitor userActivityMonitor,
            IUpdateCheckerFactory updateCheckerFactory,
            IProcessStartProvider processStartProvider,
            IUpdatePromptProvider updatePromptProvider,
            IAssemblyProvider assemblyProvider,
            Func<IUpdateVariantHandler> updateVariantHandlerFactory)
        {
            this.applicationState = applicationState;
            this.applicationWindowState = applicationWindowState;
            this.userActivityMonitor = userActivityMonitor;
            this.updateCheckerFactory = updateCheckerFactory;
            this.processStartProvider = processStartProvider;
            this.updatePromptProvider = updatePromptProvider;
            this.assemblyProvider = assemblyProvider;
            this.updateVariantHandlerFactory = updateVariantHandlerFactory;

            this.promptTimer = new DispatcherTimer();
            this.promptTimer.Tick += this.PromptTimerElapsed;

            // Strategy time:
            // We'll prompt the user a fixed period after the computer starts up / resumes from sleep
            // (this is handled by CheckForUpdates being set to true, if appropriate, by another part of the application)
            // We'll also check on a fixed interval since this point
            // If 'remind me later' is active, we'll also check when the application is restored from tray

            this.applicationState.ResumeFromSleep += this.ResumeFromSleep;
            this.applicationWindowState.RootWindowActivated += this.RootWindowActivated;
        }
Exemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance of the TrailerViewModel class.
 /// </summary>
 /// <param name="movieService">Movie service</param>
 /// <param name="applicationState">Application state</param>
 /// <param name="movieHistoryService">Movie history service</param>
 public TrailerViewModel(IMovieService movieService, IApplicationState applicationState,
     IMovieHistoryService movieHistoryService)
 {
     _movieService = movieService;
     _applicationState = applicationState;
     _movieHistoryService = movieHistoryService;
 }
Exemplo n.º 25
0
        public AccountSelectorViewModel(IAccountService accountService, ICacheService cacheService, IApplicationState applicationState, IEntityService entityService,
            IReportServiceClient reportServiceClient)
        {
            _accounts = new ObservableCollection<AccountScreenRow>();
            _accountService = accountService;
            _cacheService = cacheService;
            _applicationState = applicationState;
            _entityService = entityService;
            _reportServiceClient = reportServiceClient;
            ShowAccountDetailsCommand = new CaptionCommand<string>(Resources.AccountDetails.Replace(' ', '\r'), OnShowAccountDetails, CanShowAccountDetails);
            PrintCommand = new CaptionCommand<string>(Resources.Print, OnPrint);
            AccountButtonSelectedCommand = new CaptionCommand<AccountScreen>("", OnAccountScreenSelected);
            AutomationCommandSelectedCommand = new CaptionCommand<AccountScreenAutmationCommandMap>("", OnAutomationCommandSelected);

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(
            x =>
            {
                if (x.Topic == EventTopicNames.ResetCache)
                {
                    _accountButtons = null;
                    _batchDocumentButtons = null;
                    _selectedAccountScreen = null;
                }
            });
        }
Exemplo n.º 26
0
        public TicketViewModel(Ticket model, TicketTemplate ticketTemplate, bool forcePayment,
            ITicketService ticketService, IAutomationService automationService,
            IApplicationState applicationState)
        {
            _ticketService = ticketService;
            _forcePayment = forcePayment;
            _model = model;
            _ticketTemplate = ticketTemplate;
            _automationService = automationService;
            _applicationState = applicationState;

            _orders = new ObservableCollection<OrderViewModel>(model.Orders.Select(x => new OrderViewModel(x, ticketTemplate, _automationService)).OrderBy(x => x.Model.CreatedDateTime));
            _itemsViewSource = new CollectionViewSource { Source = _orders };
            _itemsViewSource.GroupDescriptions.Add(new PropertyGroupDescription("GroupObject"));

            SelectAllItemsCommand = new CaptionCommand<string>("", OnSelectAllItemsExecute);

            PrintJobButtons = _applicationState.CurrentTerminal.PrintJobs
                .Where(x => (!string.IsNullOrEmpty(x.ButtonHeader))
                    && (x.PrinterMaps.Count(y => y.DepartmentId == 0 || y.DepartmentId == model.DepartmentId) > 0))
                .OrderBy(x => x.Order)
                .Select(x => new PrintJobButton(x, Model));

            if (PrintJobButtons.Count(x => x.Model.UseForPaidTickets) > 0)
            {
                PrintJobButtons = IsPaid
                    ? PrintJobButtons.Where(x => x.Model.UseForPaidTickets)
                    : PrintJobButtons.Where(x => !x.Model.UseForPaidTickets);
            }
        }
Exemplo n.º 27
0
        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);
                        }
                    }
                }
            });
        }
Exemplo n.º 28
0
 public AccountBalances(IApplicationState applicationState, ICacheService cacheService, IAccountDao accountDao)
 {
     _applicationState = applicationState;
     _cacheService = cacheService;
     _accountDao = accountDao;
     Balances = new Dictionary<int, decimal>();
 }
Exemplo n.º 29
0
 public SettingsManager(IApplicationState state, IPluginManager pluginManager, IApplicationConfig config, ApplicationSettingsBase settings)
 {
     _settings = settings;
     _state = state;
     _pluginManager = pluginManager;
     _config = config;
 }
 public AutomationButtonWidgetViewModel(Widget widget, IApplicationState applicationState, IAutomationDao automationDao)
     : base(widget, applicationState)
 {
     _applicationState = applicationState;
     _automationDao = automationDao;
     ItemClickedCommand = new CaptionCommand<AutomationButtonWidgetViewModel>("", OnItemClicked);
 }
 public HtmlViewerWidgetViewModel(Widget model, IApplicationState applicationState)
     : base(model, applicationState)
 {
 }
Exemplo n.º 32
0
 public ResourceDashboardViewModel(IApplicationState applicationState, IResourceService resourceService)
 {
     _applicationState = applicationState;
     _resourceService  = resourceService;
 }
 public InsuranceAndAuthorizationsPageViewModel(INavigationService navigationService, IApplicationState applicationState) : base(applicationState)
 {
     _navigationService = navigationService;
 }
 protected AbstractCidDevice(ICacheService cacheService, IApplicationState applicationState, IEntityService entityService)
 {
     _cacheService     = cacheService;
     _applicationState = applicationState;
     _entityService    = entityService;
 }
Exemplo n.º 35
0
 public ViewModelFactory(IApplicationConfig config, IPluginManager pluginManager, IApplicationState state, IPresetsManager presetsManager, IMediaService mediaService)
 {
     _config         = config;
     _pluginManager  = pluginManager;
     _state          = state;
     _presetsManager = presetsManager;
     _mediaService   = mediaService;
 }
Exemplo n.º 36
0
 public EndDayReportViewModel(IUserService userService, IApplicationState applicationState, ILogService logService, ISettingService settingService)
     : base(userService, applicationState, logService, settingService)
 {
 }
Exemplo n.º 37
0
 public HomeController(IApplicationState applicationState, IRequestHandlerFactory factory, IHostEnvironment hostingEnvironment)
 {
     _applicationState   = applicationState;
     _hostingEnvironment = hostingEnvironment;
     _handler            = factory.GetHandler();
 }
Exemplo n.º 38
0
 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);
 }
Exemplo n.º 39
0
 public LoopValues(IApplicationState applicationState)
 {
     _applicationState = applicationState;
 }
Exemplo n.º 40
0
 public CsvBuilderViewModel(IUserService userService, IApplicationState applicationState)
     : base(userService, applicationState)
 {
 }
Exemplo n.º 41
0
 public DepartmentSelectorView(IApplicationStateSetter applicationStateSetter, IApplicationState applicationState,
                               IUserService userService)
 {
     InitializeComponent();
     _applicationStateSetter = applicationStateSetter;
     DataContext             = new DepartmentSelectorViewModel(applicationState, _applicationStateSetter, userService);
 }
Exemplo n.º 42
0
 public TransactionDocumentListViewModel(IApplicationState applicationState)
 {
     _applicationState = applicationState;
 }
Exemplo n.º 43
0
 public UserService(IUserDao userDao, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter)
 {
     _userDao                = userDao;
     _applicationState       = applicationState;
     _applicationStateSetter = applicationStateSetter;
 }
Exemplo n.º 44
0
 public AdvancedModemDevice(string key, string name, IApplicationState applicationState, ICacheService cacheService, IEntityService entityService, IApplicationStateSetter applicationStateSetter, IPrinterService printerService) : base(key, name, cacheService, applicationState, entityService, applicationStateSetter, printerService)
 {
 }
Exemplo n.º 45
0
 //
 public ReportServiceClient(IReportService reportService, IApplicationState applicationState)
 {
     _reportService    = reportService;
     _applicationState = applicationState;
 }
 public GenericModemDevice(IApplicationState applicationState, ICacheService cacheService, IEntityService entityService)
     : base(cacheService, applicationState, entityService)
 {
 }
Exemplo n.º 47
0
 public IDiagram CreateWidgetViewModel(Widget widget, IApplicationState applicationState)
 {
     return(new TicketListerWidgetViewModel(widget, applicationState, _ticketServiceBase, _printerService, _cacheService, _automationDao));
 }
Exemplo n.º 48
0
        public LoginPageViewModel(INavigationService navigationService, IAccountService accountService, IApplicationState applicationState, IConnectivity connectivity, IOfflineServices offlineServices, ISecureAppStorage secureAppStorage, IDataUpdateService dataUpdateService, IDatabaseService databaseService, ISessionUpdateService sessionUpdateService, ISettingsService settingsService, IUpdateService updateService, IPageDialogService pageDialogService)
        {
            _navigationService    = navigationService;
            _accountService       = accountService;
            _applicationState     = applicationState;
            _connectivity         = connectivity;
            _offlineServices      = offlineServices;
            _secureAppStorage     = secureAppStorage;
            _dataUpdateService    = dataUpdateService;
            _databaseService      = databaseService;
            _sessionUpdateService = sessionUpdateService;
            _settingsService      = settingsService;
            _updateService        = updateService;
            _pageDialogService    = pageDialogService;

            Login  = new DelegateCommand(() => OnLoginCommand().IgnoreResult());
            Update = new DelegateCommand(() => OnUpdateCommand().IgnoreResult());
        }
 public SetActiveTicketType(ICacheService cacheService, IApplicationState applicationState)
 {
     _cacheService     = cacheService;
     _applicationState = applicationState;
 }
Exemplo n.º 50
0
 public PresetsManager(IApplicationConfig config, IApplicationState state, IPluginManager pluginManager)
 {
     _config        = config;
     _state         = state;
     _pluginManager = pluginManager;
 }
 public DataLoadedCommandHandler(IContainer container, IApplicationState applicationState, IUIThreadInvoker uiThreadInvoker)
 {
     _container        = container;
     _applicationState = applicationState;
     _uiThreadInvoker  = uiThreadInvoker;
 }
Exemplo n.º 52
0
        public SettingsViewModel(
            IConfigurationProvider configurationProvider,
            IAutostartProvider autostartProvider,
            IWindowManager windowManager,
            IProcessStartProvider processStartProvider,
            IAssemblyProvider assemblyProvider,
            IApplicationState applicationState,
            IApplicationPathsProvider applicationPathsProvider,
            ISyncthingManager syncthingManager,
            IMeteredNetworkManager meteredNetworkManager)
        {
            this.configurationProvider    = configurationProvider;
            this.autostartProvider        = autostartProvider;
            this.windowManager            = windowManager;
            this.processStartProvider     = processStartProvider;
            this.assemblyProvider         = assemblyProvider;
            this.applicationState         = applicationState;
            this.applicationPathsProvider = applicationPathsProvider;
            this.syncthingManager         = syncthingManager;

            this.MinimizeToTray      = this.CreateBasicSettingItem(x => x.MinimizeToTray);
            this.NotifyOfNewVersions = this.CreateBasicSettingItem(x => x.NotifyOfNewVersions);
            this.CloseToTray         = this.CreateBasicSettingItem(x => x.CloseToTray);
            this.ObfuscateDeviceIDs  = this.CreateBasicSettingItem(x => x.ObfuscateDeviceIDs);
            this.UseComputerCulture  = this.CreateBasicSettingItem(x => x.UseComputerCulture);
            this.UseComputerCulture.RequiresSyncTrayzorRestart = true;
            this.DisableHardwareRendering = this.CreateBasicSettingItem(x => x.DisableHardwareRendering);
            this.DisableHardwareRendering.RequiresSyncTrayzorRestart = true;
            this.EnableConflictFileMonitoring = this.CreateBasicSettingItem(x => x.EnableConflictFileMonitoring);
            this.EnableFailedTransferAlerts   = this.CreateBasicSettingItem(x => x.EnableFailedTransferAlerts);

            this.PauseDevicesOnMeteredNetworks          = this.CreateBasicSettingItem(x => x.PauseDevicesOnMeteredNetworks);
            this.PauseDevicesOnMeteredNetworksSupported = meteredNetworkManager.IsSupportedByWindows;

            this.ShowTrayIconOnlyOnClose = this.CreateBasicSettingItem(x => x.ShowTrayIconOnlyOnClose);
            this.ShowSynchronizedBalloonEvenIfNothingDownloaded = this.CreateBasicSettingItem(x => x.ShowSynchronizedBalloonEvenIfNothingDownloaded);
            this.ShowDeviceConnectivityBalloons     = this.CreateBasicSettingItem(x => x.ShowDeviceConnectivityBalloons);
            this.ShowDeviceOrFolderRejectedBalloons = this.CreateBasicSettingItem(x => x.ShowDeviceOrFolderRejectedBalloons);

            this.IconAnimationModes = new BindableCollection <LabelledValue <IconAnimationMode> >()
            {
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_DataTransferring, Services.Config.IconAnimationMode.DataTransferring),
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_Syncing, Services.Config.IconAnimationMode.Syncing),
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_Disabled, Services.Config.IconAnimationMode.Disabled),
            };
            this.IconAnimationMode = this.CreateBasicSettingItem(x => x.IconAnimationMode);

            this.StartSyncthingAutomatically = this.CreateBasicSettingItem(x => x.StartSyncthingAutomatically);
            this.SyncthingPriorityLevel      = this.CreateBasicSettingItem(x => x.SyncthingPriorityLevel);
            this.SyncthingPriorityLevel.RequiresSyncthingRestart = true;
            this.SyncthingAddress = this.CreateBasicSettingItem(x => x.SyncthingAddress, new SyncthingAddressValidator());
            this.SyncthingAddress.RequiresSyncthingRestart = true;

            this.CanReadAutostart  = this.autostartProvider.CanRead;
            this.CanWriteAutostart = this.autostartProvider.CanWrite;
            if (this.autostartProvider.CanRead)
            {
                var currentSetup = this.autostartProvider.GetCurrentSetup();
                this.StartOnLogon   = currentSetup.AutoStart;
                this.StartMinimized = currentSetup.StartMinimized;
            }

            this.SyncthingCommandLineFlags = this.CreateBasicSettingItem(
                x => String.Join(" ", x.SyncthingCommandLineFlags),
                (x, v) =>
            {
                KeyValueStringParser.TryParse(v, out var envVars, mustHaveValue: false);
                x.SyncthingCommandLineFlags = envVars.Select(item => KeyValueStringParser.FormatItem(item.Key, item.Value)).ToList();
            }, new SyncthingCommandLineFlagsValidator());
Exemplo n.º 53
0
        public AccountSelectorViewModel(IAccountService accountService, ICacheService cacheService, IApplicationState applicationState, IEntityService entityService,
                                        IReportServiceClient reportServiceClient)
        {
            _accounts                        = new ObservableCollection <AccountScreenRow>();
            _accountService                  = accountService;
            _cacheService                    = cacheService;
            _applicationState                = applicationState;
            _entityService                   = entityService;
            _reportServiceClient             = reportServiceClient;
            ShowAccountDetailsCommand        = new CaptionCommand <string>(Resources.AccountDetails.Replace(' ', '\r'), OnShowAccountDetails, CanShowAccountDetails);
            PrintCommand                     = new CaptionCommand <string>(Resources.Print, OnPrint);
            AccountButtonSelectedCommand     = new CaptionCommand <AccountScreen>("", OnAccountScreenSelected);
            AutomationCommandSelectedCommand = new CaptionCommand <AccountScreenAutmationCommandMap>("", OnAutomationCommandSelected);

            EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe(
                x =>
            {
                if (x.Topic == EventTopicNames.ResetCache)
                {
                    _accountButtons        = null;
                    _batchDocumentButtons  = null;
                    _selectedAccountScreen = null;
                }
            });
        }
Exemplo n.º 54
0
        public Shell(IApplicationState applicationState, IMethodQueue methodQueue)
        {
            _applicationState = applicationState;
            _methodQueue      = methodQueue;
            InitializeComponent();
            LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(
                    XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            Application.Current.MainWindow.SizeChanged += MainWindow_SizeChanged;

            var selectedIndexChange = DependencyPropertyDescriptor.FromProperty(Selector.SelectedIndexProperty, typeof(TabControl));

            selectedIndexChange.AddValueChanged(MainTabControl, MainTabControlSelectedIndexChanged);

            EventServiceFactory.EventService.GetEvent <GenericEvent <User> >().Subscribe(x =>
            {
                if (x.Topic == EventTopicNames.UserLoggedIn)
                {
                    UserLoggedIn(x.Value);
                }
                if (x.Topic == EventTopicNames.UserLoggedOut)
                {
                    UserLoggedOut(x.Value);
                }
            });

            EventServiceFactory.EventService.GetEvent <GenericEvent <UserControl> >().Subscribe(
                x =>
            {
                if (x.Topic == EventTopicNames.DashboardClosed)
                {
                    SerialPortService.ResetCache();
                    EventServiceFactory.EventService.PublishEvent(EventTopicNames.ResetCache, true);
                }
            });

            EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe(
                x =>
            {
                if (x.Topic == EventTopicNames.LocalSettingsChanged)
                {
                    InteractionService.Scale(MainGrid);
                }
            });



            UserRegion.Visibility      = Visibility.Collapsed;
            RightUserRegion.Visibility = Visibility.Collapsed;
            Height = Properties.Settings.Default.ShellHeight;
            Width  = Properties.Settings.Default.ShellWidth;



            _timer         = new DispatcherTimer();
            _timer.Tick   += TimerTick;
            TimeLabel.Text = "...";

#if !DEBUG
            WindowStyle = WindowStyle.None;
            WindowState = WindowState.Maximized;
#endif
        }
Exemplo n.º 55
0
 public IDiagram CreateWidgetViewModel(Widget widget, IApplicationState applicationState)
 {
     return(new EntityGridWidgetViewModel(widget, applicationState, _entityService, _userService, _cacheService));
 }
Exemplo n.º 56
0
 public PinLoginViewModel(IApplicationState state, ILoginService loginService)
 {
     _state        = state;
     _loginService = loginService;
 }
Exemplo n.º 57
0
 //
 public UserInteraction(IMethodQueue methodQueue, IApplicationState applicationState)
 {
     _methodQueue        = methodQueue;
     _popupDataViewModel = new PopupDataViewModel(applicationState);
 }
Exemplo n.º 58
0
 public RefreshCache(IMethodQueue methodQueue, ITriggerService triggerService, IApplicationState applicationState)
 {
     _methodQueue      = methodQueue;
     _triggerService   = triggerService;
     _applicationState = applicationState;
 }
Exemplo n.º 59
0
        public ManualEntryWizardController(Case thisCase, INavigationService navigationService, IDataUpdateService dataUpdateService, IDatabaseService databaseService, ISessionUpdateService sessionUpdateService, IApplicationState applicationState)
        {
            _navigationService    = navigationService;
            _dataUpdateService    = dataUpdateService;
            _databaseService      = databaseService;
            _sessionUpdateService = sessionUpdateService;
            _applicationState     = applicationState;

            var now = DateTime.Now;

            _entryBaseInfoPageModel.Case          = thisCase;
            _entryBaseInfoPageModel.DateOfService = now.Date;
            _entryBaseInfoPageModel.StartTime     = (now - now.Date).RoundUpTo(15);
            _entryBaseInfoPageModel.EndTime       = _entryBaseInfoPageModel.StartTime + TimeSpan.FromMinutes(30);
        }
Exemplo n.º 60
0
 public ResourceButtonWidgetCreator(ICacheService cacheService, IApplicationState applicationState, IResourceService resourceService)
 {
     _cacheService     = cacheService;
     _applicationState = applicationState;
     _resourceService  = resourceService;
 }