コード例 #1
0
        public MainWindowViewModel(IDataAccessService dataAccessService, ViewModelLocator viewModelLocator)
        {
            _dataAccessService = dataAccessService;
            _viewModelLocator = viewModelLocator;

            OpenClientManagerCommand = new RelayCommand(SetCurrentVMToClientVM);
        }
コード例 #2
0
        public MainWindowViewModel(IProjectDocumentFactory projectFactory, IDialogService dialogService, IDataAccessService dataService)
        {
            _projectFactory = projectFactory;
            _dialogService = dialogService;
            _dataService = dataService;

            ProjectViewModel = new ProjectViewModel();

            ViewModelMediator.Current.GetEvent<ProjectOpenedEventArgs>().Subscribe(this.ProjectOpened);
            ViewModelMediator.Current.GetEvent<TestLocationSelectedEventArgs>().Subscribe(this.TestLocationSelected);

            AppData = StoredAppData.Load();

            var attr = this.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute)).Single() as AssemblyProductAttribute;
            ApplicationName = attr.Product;
            WindowTitle = attr.Product;

            OpenProjectCommand = new RelayCommand(OpenProjectDialog, null);
            OpenRecentCommand = new RelayCommand(OpenRecentProject, null);
            SaveProjectCommand = new RelayCommand(x => SaveProject(), o => _openProject != null);
            CloseProjectCommand = new RelayCommand(CloseProject, o => _openProject != null);
            TestCommand = new RelayCommand(TestProject, o => _openProject != null);
            TestStageCommand = new RelayCommand(TestStage, o => _openProject != null);
            TestLocationCommand = new RelayCommand(TestLocation, o => _openProject != null);
            UndoCommand = new RelayCommand(Undo, p => ProjectViewModel.CurrentStage != null);
            RedoCommand = new RelayCommand(Redo, p => ProjectViewModel.CurrentStage != null);
            EnginePathCommand = new RelayCommand(ChangeEnginePath);
            NewEntityCommand = new RelayCommand(NewEntity);
            UpdateLayerVisibilityCommand = new RelayCommand(UpdateLayerVisibility);

            ShowBackstage = true;
        }
コード例 #3
0
 public UserManagementService(IDataAccessService dataAccessService)
 {
     if (dataAccessService == null)
     {
         throw new ArgumentNullException("dataAccessService");
     }
     DataAccessService = dataAccessService;
 }
コード例 #4
0
        public ClientTabViewModel(IDataAccessService dataAccessService, Client currentClient)
        {
            _dataAccessService = dataAccessService;
            _currentClient = currentClient;
            _originalCurrentClinet = (Client)_currentClient.Clone();

            CloseTabCommand = new RelayCommand(closeTab);
            SaveCurrentCommand = new RelayCommand(saveCurrentClient, canSaveCurrentClientExecute);

        }
コード例 #5
0
		public MenuItemRepository(IDataAccessController dataAccessController,
		IDataAccessService dataAccessService)
		{
			_dataAccessController = dataAccessController;
			_menuItemCacheRepository = new MenuItemCacheRepository(dataAccessService);
			_menuItemVersionRepository = new MenuItemVersionRepository(dataAccessService);
			_menuItems2TaxesCacheRepository = new MenuItems2TaxesCacheRepository(dataAccessService);
			_menuItems2TaxesVersionRepository = new MenuItems2TaxesVersionRepository(dataAccessService);
			_taxCacheRepository = new TaxCacheRepository(dataAccessService);
		}
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the MainViewModel class.
 /// The class gets an instance of The DataAccessService
 /// </summary>
 public MainViewModel(IDataAccessService servPxy)
 {
     _serviceProxy = servPxy;
     Employees = new ObservableCollection<EmployeeInfo>();
     EmpInfo = new EmployeeInfo(); 
     ReadAllCommand = new RelayCommand(GetEmployees);
     SaveCommand = new RelayCommand<EmployeeInfo>(SaveEmployee);
     SearchCommand = new RelayCommand(SearchEmployee);
     SendEmployeeCommand = new RelayCommand<EmployeeInfo>(SendEmployeeInfo);
     ReceiveEmployeeInfo();
 }
コード例 #7
0
        public NewProjectViewModel(IProjectDocumentFactory projectFactory, IDataAccessService dataService)
        {
            _projectFactory = projectFactory;
            _dataService = dataService;

            CreateCommand = new RelayCommand(Create);

            Name = GetDefaultProjectName();
            Author = GetMostRecentAuthor();
            DirectoryPath = GetMostRecentDirectory();
            CreateProjectDirectory = true;
        }
コード例 #8
0
        public AddStageViewModel(ITilesetDocumentFactory tilesetFactory, IDataAccessService dataService)
        {
            _tilesetFactory = tilesetFactory;
            _dataService = dataService;

            ViewModelMediator.Current.GetEvent<ProjectOpenedEventArgs>().Subscribe(ProjectChanged);

            AddStageCommand = new RelayCommand(AddStage);
            BrowseTilesetCommand = new RelayCommand(BrowseTileset);
            BrowseTilesheetCommand = new RelayCommand(BrowseTilesheet);

            CreateTileset = true;
        }
コード例 #9
0
ファイル: ClientViewModel.cs プロジェクト: mengqingaaa/LTIPCM
        public ClientViewModel(IDataAccessService dataAccessService, ViewModelLocator viewModelLocator)
        {
            _dataAccessService = dataAccessService;
            _viewModelLocator = viewModelLocator;

            //_clients = new ObservableCollection<Client>();
            //GetClients();
            _clients = _dataAccessService.GetClients();

            OpenExistedClientTabCommand = new RelayCommand<Client>(OpenExistedClientTab);

            // Register the Tab Close Messenger
            Messenger.Default.Register<Client>(this, "CloseClientTabItem", CloseClientTab);
        }
コード例 #10
0
 internal CustomerInformationInquiryClientProxy(IDataAccessService dataAccessService, 
                                                 IMappingEngine mapper,
                                                 ILoadedLocation loadedLocation,
                                                 ILoggedInUser loggedInUser)
 {
     _dataAccessService = dataAccessService;
     _mapper = mapper;
     _headerArgs = new HeaderArgs
     (
         loadedLocation.DpiRegion(),
         loggedInUser.Name(),
         string.Empty,
         loggedInUser.Name(),
         loggedInUser.Email(),
         loggedInUser.Role()
     );
 }
コード例 #11
0
 public IdentityProviderController(
     IExecutionContextManager executionContextManager,
     IAssetsService assetsService,
     IDataAccessService dataAccessService,
     IIdentityAttributesService identityAttributesService,
     IAccountsServiceEx accountsService,
     ITranslatorsRepository translatorsRepository,
     IHubContext <IdentitiesHub> idenitiesHubContext,
     ILoggerService loggerService)
 {
     _executionContextManager   = executionContextManager;
     _assetsService             = assetsService;
     _dataAccessService         = dataAccessService;
     _identityAttributesService = identityAttributesService;
     _accountsService           = accountsService;
     _translatorsRepository     = translatorsRepository;
     _idenitiesHubContext       = idenitiesHubContext;
     _logger = loggerService.GetLogger(nameof(IdentityProviderController));
 }
コード例 #12
0
        public LevelsViewModel(ListView view,
                               List <Level> items,
                               AppObjectBase[] selectedItems,
                               IDataAccessService das)
            : base(view, das)
        {
            this.view       = view;
            base.Title      = "Уровни доступа";
            this.das        = das;
            this.items      = items;
            this.itemsArray = this.items.ToArray();
            base.ItemProperties.Add("IsChecked");
            base.ItemProperties.Add("Name");
            base.ItemProperties.Add("Description");
            base.ItemProperties.Add("Id");

            base.CheckItems(selectedItems);
            base.SubscribeOnItemChanged();
        }
コード例 #13
0
        public ExternalIdpsInitializer(IDataAccessService dataAccessService, IAccountsService accountsService, IExecutionContextManager executionContextManager,
                                       IConfigurationService configurationService, ILoggerService loggerService)
        {
            if (configurationService is null)
            {
                throw new System.ArgumentNullException(nameof(configurationService));
            }

            if (loggerService is null)
            {
                throw new System.ArgumentNullException(nameof(loggerService));
            }

            _dataAccessService       = dataAccessService ?? throw new System.ArgumentNullException(nameof(dataAccessService));
            _accountsService         = accountsService ?? throw new System.ArgumentNullException(nameof(accountsService));
            _executionContextManager = executionContextManager;
            _azureConfiguration      = configurationService.Get <IAzureConfiguration>();
            _logger = loggerService.GetLogger(nameof(ExternalIdpsInitializer));
        }
コード例 #14
0
 /// <summary>
 /// Initializes a new instance of the MainViewModel class.
 /// </summary>
 public MainViewModel(IDataAccessService dataAccessService)
 {
     ////if (IsInDesignMode)
     ////{
     ////    // Code runs in Blend --> create design time data.
     ////}
     ////else
     ////{
     ////    // Code runs "for real"
     ////}
     this.dataAccessService   = dataAccessService;
     this.Employees           = new ObservableCollection <Employees>();
     this.EmpInfo             = new Employees();
     this.ReadAllCommand      = new RelayCommand(this.GetEmployees);
     this.SaveCommand         = new RelayCommand <Employees>(this.SaveEmployee);
     this.SearchCommand       = new RelayCommand(this.SearchEmployee);
     this.SendEmployeeCommand = new RelayCommand <Employees>(SendEmployeeInfo);
     this.ReceiveEmployeeInfo();
 }
コード例 #15
0
 public AthleteStatsVM(IDataAccessService DbAccess, IEChartsService EChartsService)
 {
     _Logger         = NLog.LogManager.GetCurrentClassLogger();
     _DbAccess       = DbAccess;
     _EChartsService = EChartsService;
     Messenger.Default.Register <NotificationMessage <IList <ActivityEntity> > >(this, message =>
     {
         if (message.Notification == MessengerNotifications.LOADED)
         {
             if (message.Content == null)
             {
                 Activities = new ObservableCollection <ActivityEntity>();
             }
             else
             {
                 Activities = new ObservableCollection <ActivityEntity>(message.Content);
             }
         }
     });
 }
 public BatchCloudDataController(
     IDataAccessService _dataAccessService,
     ISearchConditionService _searchConditionService,
     ISearchConditionNodeService _conditionAggregationService,
     IInterfaceAggregationService _interfaceAggregationService,
     IFieldBizDataService _fieldBizDataService,
     ITriggerScriptService triggerScriptService,
     IMetaObjectService _metaObjectService,
     IFormMetaFieldService formMetaFieldService
     )
 {
     dataAccessService           = _dataAccessService;
     conditionAggregationService = _conditionAggregationService;
     interfaceAggregationService = _interfaceAggregationService;
     fieldBizDataService         = _fieldBizDataService;
     _triggerScriptService       = triggerScriptService;
     searchConditionService      = _searchConditionService;
     metaObjectService           = _metaObjectService;
     _formMetaFieldService       = formMetaFieldService;
 }
コード例 #17
0
 public IdentityProviderController(
     IExecutionContextManager executionContextManager,
     IAssetsService assetsService,
     IDataAccessService dataAccessService,
     IDataAccessService externalDataAccessService,
     IIdentityAttributesService identityAttributesService,
     IFacesService facesService,
     IAccountsService accountsService,
     IConfigurationService configurationService,
     IHubContext <IdentitiesHub> hubContext)
 {
     _dataAccessService         = dataAccessService;
     _executionContextManager   = executionContextManager;
     _assetsService             = assetsService;
     _externalDataAccessService = externalDataAccessService;
     _identityAttributesService = identityAttributesService;
     _accountsService           = accountsService;
     _hubContext          = hubContext;
     _portalConfiguration = configurationService.Get <IPortalConfiguration>();
 }
コード例 #18
0
 public IndexPageController(
     IDataAccessService _dataAccessService,
     ISearchConditionService _searchConditionService,
     ISearchConditionAggregationService _conditionAggregationService,
     IIndexViewService _indexViewService,
     IFieldBizDataService _fieldBizDataService,
     ITriggerScriptEngineService _triggerScriptEngineService,
     IMetaObjectService _metaObjectService,
     IMetaFieldService _metaFieldService
     )
 {
     dataAccessService           = _dataAccessService;
     conditionAggregationService = _conditionAggregationService;
     indexViewService            = _indexViewService;
     fieldBizDataService         = _fieldBizDataService;
     triggerScriptEngineService  = _triggerScriptEngineService;
     searchConditionService      = _searchConditionService;
     metaObjectService           = _metaObjectService;
     metaFieldService            = _metaFieldService;
 }
コード例 #19
0
        public static async void LogAuditEvent(IDataAccessService das, System.Windows.Window view, string audit_group, string audit_action, string computer_name = null, string appBuild = null, string extension = null)
        {
            CancellationTokenSource CTS   = new CancellationTokenSource();
            CancellationToken       token = CTS.Token;

            try
            {
                await das.LogAuditEventAsync(token, audit_group, audit_action, computer_name, appBuild, extension);
            }
            catch (Exception e)
            {
                if (e is TaskCanceledException)
                {
                }
                else
                {
                    CTS.Cancel();
                    Message.ShowError(e.Message, e.GetType().ToString(), view);
                }
            }
        }
コード例 #20
0
        protected static void ConfigureServices()
        {
            // get configuration
            _configuration = new ConfigurationBuilder()
                             .SetBasePath(Directory.GetCurrentDirectory())
                             .AddJsonFile("appSettings.json")
                             .Build();
            // get options
            _appSettings = _configuration.GetSection("AppSettings").Get <AppSettings>();
            // configure services
            var services = new ServiceCollection()
                           .AddOptions()
                           // configure options
                           .Configure <AppSettings>(_configuration.GetSection("AppSettings"))
                           .AddSingleton(_configuration)
                           .AddTransient <IDataAccessService, DataAccessService>();

            // get injected components
            _serviceProvider   = services.BuildServiceProvider();
            _dataAccessService = _serviceProvider.GetService <IDataAccessService>();
        }
コード例 #21
0
 public ElectionCommitteeService(
     IDataAccessService dataAccessService,
     IAccountsService accountsService,
     IAssetsService assetsService,
     IIdentityAttributesService identityAttributesService,
     IIdentityKeyProvidersRegistry identityKeyProvidersRegistry,
     ITranslatorsRepository translatorsRepository,
     ISchemeResolverService schemeResolverService,
     IExecutionContextManager executionContextManager,
     ILoggerService loggerService)
 {
     _dataAccessService         = dataAccessService;
     _accountsService           = accountsService;
     _assetsService             = assetsService;
     _identityAttributesService = identityAttributesService;
     _identityKeyProvider       = identityKeyProvidersRegistry.GetInstance();
     _translatorsRepository     = translatorsRepository;
     _schemeResolverService     = schemeResolverService;
     _executionContextManager   = executionContextManager;
     _logger = loggerService.GetLogger(nameof(ElectionCommitteeService));
 }
コード例 #22
0
        /// <summary>
        /// Funcion para enviar valores a variables en el PLC
        /// </summary>
        /// <param name="variables">Lista de variables</param>
        /// <param name="values">Lista de Valores</param>
        /// <returns>Regresa Bool si tiene exito o no en el envio</returns>
        public Boolean SendPLC(List <string> variables, List <object> values)
        {
            try
            {
                device.Connect(this.IP, 41100, 2000);
                IDataAccessService myDataAccessService1 = device.GetService <IDataAccessService>();

                if (myDataAccessService1 != null)
                {
                    myDataAccessService1.WriteVariables(variables, values);
                }

                device.Disconnect();
                device.Dispose();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
コード例 #23
0
        public PersonViewModel(PersonView view,
                               IDataAccessService das,
                               SettingsViewModel settings,
                               Permissions appUserPermissions,
                               List <Person> persons)
            : base()
        {
            this.view               = view;
            this.das                = das;
            this.settings           = settings;
            this.appUserPermissions = appUserPermissions;

            this.persons           = persons;
            this.title             = "Сотрудник";
            this.personPhotos      = new Dictionary <int, BitmapImage>();
            this.personPhotoKey    = -1;
            this.personPhotoSetter = new NotifyTaskCompletion <Person>(getNullPersonPhoto());
            if (this.persons.Count() != -1)
            {
                this.Person = this.persons[(this.persons.Count() - 1)];
            }
        }
コード例 #24
0
 public CloudDataController(
     IDataAccessService _dataAccessService,
     ISearchConditionNodeService _conditionAggregationService,
     IInterfaceAggregationService _interfaceAggregationService,
     ITriggerScriptService triggerScriptService,
     IDataSourceService dataSourceService,
     IMetaObjectService _metaObjectService,
     IMetaFieldService _metaFieldService,
     IFormMetaFieldService formMetaFieldService,
     IFieldListMetaFieldService fieldListMetaFieldService
     )
 {
     dataAccessService           = _dataAccessService;
     conditionAggregationService = _conditionAggregationService;
     interfaceAggregationService = _interfaceAggregationService;
     _triggerScriptService       = triggerScriptService;
     metaObjectService           = _metaObjectService;
     metaFieldService            = _metaFieldService;
     _dataSourceService          = dataSourceService;
     _formMetaFieldService       = formMetaFieldService;
     _fieldListMetaFieldService  = fieldListMetaFieldService;
 }
コード例 #25
0
        public BaseService(IHttpContextAccessor httpContextAccessor, IDataAccessService das)
        {
            var    accessor = httpContextAccessor;
            int    personId = 0;
            string role     = string.Empty;
            string token    = "";

            if (accessor.HttpContext != null)
            {
                token = accessor.HttpContext.Request.Headers["Authorization"].ToString();
            }
            if (token != null && token != "")
            {
                var jwt = new JwtSecurityToken(token.Substring(7));
                int.TryParse(jwt.Claims.First(claim => claim.Type == "personId").Value, out personId);
                role = jwt.Claims.First(claim => claim.Type == "role").Value;
            }

            das.CurrentPersonId = personId;
            das.Role            = role;
            das.UserContext     = JsonConvert.SerializeObject(new { personId });
        }
コード例 #26
0
 public ExecutionContextManager(IServiceProvider serviceProvider,
                                IHubContext <IdentitiesHub> identitiesHubContext,
                                IAssetsService assetsService,
                                IDataAccessService dataAccessService,
                                IIdentityAttributesService identityAttributesService,
                                IWitnessPackagesProviderRepository witnessPackagesProviderRepository,
                                IBlockParsersRepositoriesRepository blockParsersRepositoriesRepository,
                                IConfigurationService configurationService,
                                IGatewayService gatewayService,
                                ITrackingService trackingService,
                                ILoggerService loggerService,
                                ISpValidationsService spValidationsService,
                                IRelationsProofsValidationService relationsProofsValidationService,
                                ISchemeResolverService schemeResolverService,
                                IUniversalProofsPool universalProofsPool,
                                IExternalUpdatersRepository externalUpdatersRepository,
                                IConsentManagementService consentManagementService)
 {
     _accountIdCancellationList          = new Dictionary <long, ICollection <IDisposable> >();
     _serviceProvider                    = serviceProvider;
     _identitiesHubContext               = identitiesHubContext;
     _assetsService                      = assetsService;
     _dataAccessService                  = dataAccessService;
     _identityAttributesService          = identityAttributesService;
     _witnessPackagesProviderRepository  = witnessPackagesProviderRepository;
     _blockParsersRepositoriesRepository = blockParsersRepositoriesRepository;
     _gatewayService                     = gatewayService;
     _trackingService                    = trackingService;
     _loggerService                      = loggerService;
     _spValidationsService               = spValidationsService;
     _logger = loggerService.GetLogger(nameof(ExecutionContextManager));
     _relationsProofsValidationService = relationsProofsValidationService;
     _schemeResolverService            = schemeResolverService;
     _universalProofsPool        = universalProofsPool;
     _externalUpdatersRepository = externalUpdatersRepository;
     _consentManagementService   = consentManagementService;
     _restApiConfiguration       = configurationService.Get <IRestApiConfiguration>();
 }
コード例 #27
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IDataAccessService servProxy)
        {
            _serviceProxy = servProxy;
            Emails        = new ObservableCollection <Email>();
            ChosedEmails  = new ObservableCollection <Email>();
            EmailInfo     = new Email();

            GetEmails();

            AddRecipientsCommand    = new RelayCommand <object>(AddRecipients);
            DeleteRecipientsCommand = new RelayCommand <object>(DeleteRecipients);
            SaveCommand             = new RelayCommand <Email>(SaveEmail);
            FindByNameCommand       = new RelayCommand <string>(FindByName);

            ////if (IsInDesignMode)
            ////{
            ////    // Code runs in Blend --> create design time data.
            ////}
            ////else
            ////{
            ////    // Code runs "for real"
            ////}
        }
コード例 #28
0
        public ThreadPageViewModel()
        {
            _serviceProxy = new DataAccessService();

            int k = IOC.Get <ApplicationViewModel>().PositionTree.Count;

            ThreadID = IOC.Get <ApplicationViewModel>().PositionTree[k - 1];

            Items = new ObservableCollection <PostBubbleViewModel>();
            foreach (var item in _serviceProxy.GetPosts(ThreadID))
            {
                PostBubbleViewModel temp = new PostBubbleViewModel();

                User user = new User();
                user = _serviceProxy.GetUser(item.poster);

                temp.PostContent = item.content;
                temp.DatePosted  = item.date_posted;
                temp.PostedBy    = user.name;
                temp.ProfilePic  = user.picture;
                Items.Add(temp);
            }
        }
コード例 #29
0
        /// <summary> Constructs a new EntityApp instance. </summary>
        public EntityApp(string appName = null, string version = "1.0.0.0", string activationLogPath = null)
        {
            _shutdownTokenSource = new CancellationTokenSource();
            AppName          = appName ?? this.GetType().Name;
            Version          = new Version(version);
            Status           = EntityAppStatus.Created;
            AppEvents        = new EntityAppEvents(this);
            DataSourceEvents = new DataSourceEvents(this);
            AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload;

            // Time service and Timers service  are global singletons, we register these here, as early as possible
            this.TimeService = Vita.Entities.Services.Implementations.TimeService.Instance;
            this.RegisterService <ITimeService>(this.TimeService);
            var timers = new TimerService();

            this.RegisterService <ITimerService>(timers);
            this.RegisterService <ITimerServiceControl>(timers);

            // Logging services
            this.LogService = new LogService();
            RegisterService <ILogService>(LogService);
            this.LogService.Subscribe(OnLogEntryWritten);
            var logBatchingService = new LogBatchingService();

            RegisterService <ILogBatchingService>(logBatchingService);
            logBatchingService.Subscribe(OnLogBatchProduced);
            ActivationLog = new BufferedLog(LogContext.SystemLogContext, 10000, LogService);

            //Misc services
            var custService = new EntityModelCustomizationService(this);

            this.RegisterService <IEntityModelCustomizationService>(custService);
            this.DataAccess = new DataAccessService(this);
            RegisterService <IDataAccessService>(this.DataAccess);
            RegisterService <IBackgroundTaskService>(new DefaultBackgroundTaskService());
            RegisterService <IHashingService>(new HashingService());
        }
コード例 #30
0
ファイル: MainWindowVM.cs プロジェクト: nmayeur/OpenSportLog
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainWindowVM(IDataAccessService DbAccess)
        {
            _Logger = NLog.LogManager.GetCurrentClassLogger();
            ////if (IsInDesignMode)
            ////{
            ////    // Code runs in Blend --> create design time data.
            ////}
            ////else
            ////{
            ////    // Code runs "for real"
            ////}
            _DbAccess = DbAccess;


            // Menu items enable/disable
            Messenger.Default.Register <NotificationMessage <AthleteEntity> >(this, message =>
            {
                if (message.Notification == MessengerNotifications.SELECTED)
                {
                    IsAthleteSelected   = message.Content != null;
                    IsActivitiesEnabled = message.Content != null;
                }
            });

            SavingApp += _SavingApp;

            Messenger.Default.Register <NotificationMessage <ActivityEntity> >(this, message =>
            {
                if (message.Notification == MessengerNotifications.SELECTED)
                {
                    IsActivitySelected = message.Content != null;
                }
            });

            DbAccess.IsDirtyEvent += ((s, e) => { IsSaveFileEnabled = e.IsDirty; });
        }
        // CONSTRUCTORS
        /// <summary>
        /// Basic constructor with 1 parametr
        /// </summary>
        /// <param name="dataAccessService">Programs dataAccessService</param>
        public ApplicationViewModel(IDataAccessService dataAccessService)
        {
            this.dataAccessService = dataAccessService;
            this.sessionTimer      = new DispatcherTimer()
            {
                Interval = System.TimeSpan.FromSeconds(1)
            };
            this.randomizer = new System.Random();

            this.isDataRequireUpdate = true;
            this.gameRunning         = false;
            this.gameTime            = System.TimeSpan.FromSeconds(0);
            this.orders    = new ObservableCollection <Order>();
            this.champions = null;

            #region Window Initialize
            logInWindow   = null;
            cabinetWindow = null;
            #endregion

            #region Commands Initialize
            logIn  = new RelayCommand(LogInMethod, IsNotAuthorized);
            logOut = new RelayCommand(LogOutMethod, IsAuthorized);
            signUp = new RelayCommand(SignUpMethod, IsNotAuthorized);

            startGame    = new RelayCommand(StartGameMethod, AuthorizedAndGameIsNotRunning);
            executeOrder = new RelayCommand(ExecuteOrderMethod, GameRunningAndOrderSelected);
            searchOrder  = new RelayCommand(SearchOrderMethod, GameRunning);
            removeOrder  = new RelayCommand(RemoveOrderMethod, GameRunningAndOrderSelected);

            showCabinetOrRegistrate = new RelayCommand(ShowCabinetOrRegistrateMethod, GameIsNotRunning);
            showScores = new RelayCommand(ShowScoresMethod);
            #endregion

            sessionTimer.Tick += SessionTimer_Tick;
        }
コード例 #32
0
        /// <summary>
        /// Funcion para obtener valores del PLC
        /// </summary>
        /// <param name="variables">Lista de variables a obtener</param>
        /// <returns>lista de objetos con valores obtenidos</returns>
        public IList <object> GetPLC(List <string> variables)
        {
            try
            {
                device.Connect(this.IP, 41100, 2000);
                IDataAccessService myDataAccessService1 = device.GetService <IDataAccessService>();
                IList <object>     value = new List <object>();

                if (myDataAccessService1 != null)
                {
                    value = myDataAccessService1.ReadVariables(variables);
                }

                device.Disconnect();
                device.Dispose();
                return(value);
            }
            catch
            {
                return(new List <object> {
                    false
                });
            }
        }
コード例 #33
0
        public AccountsController(IAccountsServiceEx accountsService,
                                  IExecutionContextManager executionContextManager,
                                  IDataAccessService dataAccessService,
                                  ILoggerService loggerService,
                                  ITranslatorsRepository translatorsRepository,
                                  IOptions <AppSettings> appSettings)
        {
            if (loggerService is null)
            {
                throw new ArgumentNullException(nameof(loggerService));
            }

            if (appSettings is null)
            {
                throw new ArgumentNullException(nameof(appSettings));
            }

            _accountsService         = accountsService;
            _executionContextManager = executionContextManager;
            _dataAccessService       = dataAccessService;
            _translatorsRepository   = translatorsRepository;
            _logger      = loggerService.GetLogger(nameof(AccountsController));
            _appSettings = appSettings.Value;
        }
コード例 #34
0
        /// <summary> Constructs a new EntityApp instance. </summary>
        public EntityApp(string appName = null, string version = "1.0.0.0", string activationLogPath = null)
        {
            _services            = new Dictionary <Type, object>();
            _shutdownTokenSource = new CancellationTokenSource();
            AppName          = appName ?? this.GetType().Name;
            Version          = new Version(version);
            Status           = EntityAppStatus.Created;
            AppEvents        = new EntityAppEvents(this);
            DataSourceEvents = new DataSourceEvents(this);
            AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload;
            // Time service and Timers service  are global singletons, we register these here, as early as possible
            this.TimeService = this.RegisterService <ITimeService>(Vita.Entities.Services.Implementations.TimeService.Instance);
            var timers = this.RegisterService <ITimerService>(new TimerService());

            this.RegisterService <ITimerServiceControl>(timers as ITimerServiceControl);
            this.RegisterService <ILogService>(new DefaultLogService());
            var custService = new EntityModelCustomizationService(this);

            this.RegisterService <IEntityModelCustomizationService>(custService);
            this.DataAccess = RegisterService <IDataAccessService>(new DataAccessService(this));
            RegisterService <IBackgroundTaskService>(new DefaultBackgroundTaskService());
            RegisterService <IHashingService>(new HashingService());
            ActivationLog = new ActivationLog(activationLogPath, app: this);
        }
コード例 #35
0
ファイル: ServiceA.cs プロジェクト: r-abbott/DesignPatterns
 public ServiceA(TextWriter output, IDataAccessService dataAccessService)
 {
     _dataAccessService = dataAccessService;
     _output = output;
 }
コード例 #36
0
 public Repository()
 {
     dataAccessService = new MapEntityDataModels();
 }
コード例 #37
0
 public MenuCategoryVersionRepository(IDataAccessService dataAccessService)
     : base(dataAccessService)
 {
 }
コード例 #38
0
 public GiftCardRepository(IDataAccessService dataAccessService)
     : base(dataAccessService)
 {
 }
コード例 #39
0
 public MenuCategoryRepository(IDataAccessService dataAccessService)
     : base(dataAccessService)
 {
     _menuCategoryVersionRepository = new MenuCategoryVersionRepository(dataAccessService);
     _menuCategoryСacheRepository = new MenuCategoryСacheRepository(dataAccessService);
 }
コード例 #40
0
 public TaxCashRepository(IDataAccessService dataAccessService)
     : base(dataAccessService)
 {
 }
コード例 #41
0
 public WebAppConfigurationRepository(IDataAccessService dataAccessService)
 {
     DataAccessService = dataAccessService;
 }
コード例 #42
0
 public LibraryService()
 {
     //NOTE: you can use the "new DataAccessService()" here instead of DataAccessServiceWithLinq
     //das = new DataAccessService();
     das = new DataAccessServiceWithLinq();
 }
コード例 #43
0
 public NotificationChannelWnsFunction(IPushDataAccessService pushDataService, IDataAccessService userDataService, IConfiguration config)
 {
     this.pushDataService = pushDataService;
     this.userDataService = userDataService;
     validChannelHost     = config.GetValue <string>("Notification:Windows:ValidChannelHost");
 }
コード例 #44
0
 public TaxVersionRepository(IDataAccessService dataAccessService)
     : base(dataAccessService)
 {
 }
コード例 #45
0
        public void TestInitializer()
        {
            // initialize fake context
            FakeContext = InitializeFakeContext<ILocationRepository>();

            // explicitly create fake dependencies that need to be intercepted
            //  (all other fake dependencies will be implicitly created by FakeContext.Resolve<>)
            _fakeDataPersistence = A.Fake<IDataPersistence>();
            _fakeDataAccessService = A.Fake<IDataAccessService>();
            _fakeLocationProxies = A.Fake<IIndex<DataSource, ILocationProxy>>();
            _fakeLoadedSubscriber = A.Fake<ILoadedSubscriber>();

            // provide fake dependencies to context
            FakeContext.Provide(_fakeDataPersistence);
            FakeContext.Provide(_fakeDataAccessService);
            FakeContext.Provide(_fakeLocationProxies);
            FakeContext.Provide(_fakeLoadedSubscriber);

            // create system-under-test instance
            _locationRepositoryForTest = FakeContext.Resolve<ILocationRepository>();
        }
コード例 #46
0
 protected RepositoryBase(IDataAccessService dataAccessService)
 {
     DataAccessService = dataAccessService;
 }
コード例 #47
0
ファイル: CaseViewModel.cs プロジェクト: mengqingaaa/LTIPCM
        public CaseViewModel(IDataAccessService dataAccessService)
        {
            _dataAccessService = dataAccessService;

            OpenExistedCaseTabCommand = new RelayCommand<Case>(OpenEsistedCaseTab);
        }
コード例 #48
0
 public CreateHolidaysViewModel(IDataAccessService DataAccessService)
 {
     _DataAccessService   = DataAccessService;
     CreateHolidayCommand = new Command <Holiday>(h => CreateHoliday(newHoliday));
     Title = "Not in Work - Create Holiday";
 }
コード例 #49
0
 public ProductCategoryService(IDataAccessService dAcess)
 {
     _db = dAcess.Init();
 }
コード例 #50
0
        public ServiceProviderUpdater(ulong accountId, IStateClientCryptoService clientCryptoService, IAssetsService assetsService, IDataAccessService dataAccessService, IIdentityAttributesService identityAttributesService, IBlockParsersRepositoriesRepository blockParsersRepositoriesRepository, IGatewayService gatewayService, IStateTransactionsService transactionsService, IHubContext <IdentitiesHub> idenitiesHubContext, IAppConfig appConfig, ILoggerService loggerService)
        {
            _accountId                          = accountId;
            _clientCryptoService                = clientCryptoService;
            _assetsService                      = assetsService;
            _dataAccessService                  = dataAccessService;
            _identityAttributesService          = identityAttributesService;
            _blockParsersRepositoriesRepository = blockParsersRepositoriesRepository;
            _gatewayService                     = gatewayService;
            _transactionsService                = transactionsService;
            _idenitiesHubContext                = idenitiesHubContext;
            _appConfig                          = appConfig;
            _logger = loggerService.GetLogger(nameof(ServiceProviderUpdater));

            PipeIn = new ActionBlock <PacketBase>(p =>
            {
                if (p is DocumentSignRecord documentSignRecord)
                {
                    ProcessDocumentSignRecord(documentSignRecord);
                }

                if (p is DocumentRecord documentRecord)
                {
                    ProcessDocumentRecord(documentRecord);
                }

                if (p is DocumentSignRequest documentSignRequest)
                {
                    ProcessDocumentSignRequest(documentSignRequest);
                }

                if (p is EmployeeRegistrationRequest employeeRegistrationRequest)
                {
                    ProcessEmployeeRegistrationRequest(employeeRegistrationRequest);
                }

                if (p is OnboardingRequest packet)
                {
                    ProcessOnboarding(packet);
                }

                if (p is TransitionAuthenticationProofs transitionAuthentication)
                {
                    ProcessAuthentication(transitionAuthentication);
                }

                if (p is TransitionCompromisedProofs compromisedProofs)
                {
                    ProcessCompromisedProofs(compromisedProofs);
                }

                if (p is TransferAsset transferAsset)
                {
                    ProcessTransferAsset(transferAsset);
                }
            });
        }
コード例 #51
0
 public MenuCategoryСacheRepository(IDataAccessService dataAccessService)
     : base(dataAccessService)
 {
 }
コード例 #52
0
 public StubDataController(IDataAccessService dataAccess, IHttpContextAccessor contextAccessor, IHostingEnvironment hostEnv)
 {
     _dataAccess = dataAccess;
     _context    = contextAccessor.HttpContext;
     _hostEnv    = hostEnv;
 }
コード例 #53
0
ファイル: DataSourceEvents.cs プロジェクト: yuanfei05/vita
 public DataSourceEvents(IDataAccessService service)
 {
     _service = service;
 }