当前位置: 首页>>代码示例>>C#>>正文


C# IApplicationState类代码示例

本文整理汇总了C#中IApplicationState的典型用法代码示例。如果您正苦于以下问题:C# IApplicationState类的具体用法?C# IApplicationState怎么用?C# IApplicationState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IApplicationState类属于命名空间,在下文中一共展示了IApplicationState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditorView

        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;
        }
开发者ID:testpulse,项目名称:Pickle-Studio,代码行数:28,代码来源:EditorView.cs

示例2: DepartmentSelectorView

 public DepartmentSelectorView(IApplicationStateSetter applicationStateSetter, IApplicationState applicationState,
     IUserService userService, ICacheService cacheService)
 {
     InitializeComponent();
     _applicationStateSetter = applicationStateSetter;
     DataContext = new DepartmentSelectorViewModel(applicationState, _applicationStateSetter, userService, cacheService);
 }
开发者ID:neapolis,项目名称:SambaPOS-3,代码行数:7,代码来源:DepartmentSelectorView.xaml.cs

示例3: AccountModule

        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);
        }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:30,代码来源:AccountModule.cs

示例4: BasicReportModule

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

        }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:28,代码来源:BasicReportModule.cs

示例5: DepartmentButtonViewModel

 public DepartmentButtonViewModel(DepartmentSelectorViewModel parentViewModel,
     IApplicationState applicationState)
 {
     _parentViewModel = parentViewModel;
     _applicationState = applicationState;
     DepartmentSelectionCommand = new CaptionCommand<string>("Select", OnSelectDepartment);
 }
开发者ID:yemreguney,项目名称:SambaPOS-3,代码行数:7,代码来源:DepartmentButtonViewModel.cs

示例6: PaymentEditorViewModel

        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);
        }
开发者ID:neapolis,项目名称:SambaPOS-3,代码行数:28,代码来源:PaymentEditorViewModel.cs

示例7: AutomationCommandSelectorViewModel

 public AutomationCommandSelectorViewModel(IApplicationState applicationState, IExpressionService expressionService)
 {
     _applicationState = applicationState;
     _expressionService = expressionService;
     SelectAutomationCommand = new DelegateCommand<AutomationCommandData>(OnSelectAutomationCommand, CanSelectAutomationCommand);
     CloseCommand = new CaptionCommand<string>(Resources.Close, OnCloseCommandExecuted);
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:AutomationCommandSelectorViewModel.cs

示例8: UpdateManager

        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;
        }
开发者ID:johnhk,项目名称:SyncTrayzor,代码行数:31,代码来源:UpdateManager.cs

示例9: AccountBalances

 public AccountBalances(IApplicationState applicationState, ICacheService cacheService, IAccountDao accountDao)
 {
     _applicationState = applicationState;
     _cacheService = cacheService;
     _accountDao = accountDao;
     Balances = new Dictionary<int, decimal>();
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:AccountBalances.cs

示例10: TrailerViewModel

 /// <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;
 }
开发者ID:JnCV17,项目名称:Popcorn,代码行数:13,代码来源:TrailerViewModel.cs

示例11: AccountSelectorViewModel

        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;
                }
            });
        }
开发者ID:savasl,项目名称:SambaPOS-3,代码行数:25,代码来源:AccountSelectorViewModel.cs

示例12: BasicReportModule

        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);
                        }
                    }
                }
            });
        }
开发者ID:basio,项目名称:SambaPOS-3,代码行数:60,代码来源:BasicReportModule.cs

示例13: TicketViewModel

        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);
            }
        }
开发者ID:betology,项目名称:SambaPOS-3,代码行数:30,代码来源:TicketViewModel.cs

示例14: SettingsManager

 public SettingsManager(IApplicationState state, IPluginManager pluginManager, IApplicationConfig config, ApplicationSettingsBase settings)
 {
     _settings = settings;
     _state = state;
     _pluginManager = pluginManager;
     _config = config;
 }
开发者ID:Inner-room,项目名称:VrPlayer,代码行数:7,代码来源:SettingsManager.cs

示例15: WorkPeriodService

 public WorkPeriodService(IWorkPeriodDao workPeriodDao, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter, ILogService logService)
 {
     _workPeriodDao = workPeriodDao;
     _applicationState = applicationState;
     _applicationStateSetter = applicationStateSetter;
     _logService = logService;
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:WorkPeriodService.cs


注:本文中的IApplicationState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。