Esempio n. 1
0
        public static Expression Parse(Stream stream, IFunctionRepository functionRepository)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            if (functionRepository == null)
            {
                throw new ArgumentNullException(nameof(functionRepository));
            }

            var scanner = new JmesPathScanner(stream);

            scanner.InitializeLookaheadQueue();

            var analyzer = new JmesPathParser(scanner, functionRepository);

            if (!analyzer.Parse())
            {
                System.Diagnostics.Debug.Assert(false);
                throw new Exception("Error: syntax.");
            }

            // perform post-parsing syntax validation

            var syntax = new SyntaxVisitor();

            analyzer.Expression.Accept(syntax);

            return(new Expression(analyzer.Expression));
        }
Esempio n. 2
0
 public RoleService(RoleManager <AppRole> roleManager, IFunctionRepository functionRepository, IPermissionRepository permissionRepository, IUnitOfWork unitOfWork)
 {
     _roleManager          = roleManager;
     _functionRepository   = functionRepository;
     _permissionRepository = permissionRepository;
     _unitOfWork           = unitOfWork;
 }
Esempio n. 3
0
 public RoleService(RoleManager <AppRole> roleManager, IFunctionRepository functionRepository, IPermissionRepository permissionRepository, AppDbContext context)
 {
     _roleManager          = roleManager;
     _functionRepository   = functionRepository;
     _permissionRepository = permissionRepository;
     db = context;
 }
Esempio n. 4
0
 public FunctionService(IFunctionRepository functionRepository, IPermissionRepository permissionRepository, IApplicationRepository applicationRepository, IMapper mapper)
 {
     this.functionRepository    = functionRepository;
     this.applicationRepository = applicationRepository;
     this.permissionRepository  = permissionRepository;
     this.mapper = mapper;
 }
Esempio n. 5
0
 public RoleService(IRoleRepository roleRepository, IUserRepository userRepository, IFunctionRepository functionRepository, IMapper mapper)
 {
     this.roleRepository     = roleRepository;
     this.userRepository     = userRepository;
     this.functionRepository = functionRepository;
     this.mapper             = mapper;
 }
Esempio n. 6
0
        public JmesPathFunctionExpression(IFunctionRepository repository, string name, params JmesPathExpression[] expressions)
        {
            if (!repository.Contains(name))
            {
                throw new Exception($"Error: unknown-function, no function named {name} has been registered.");
            }

            function_ = repository[name];

            var variadic = function_.Variadic;
            var expected = function_.MinArgumentCount;
            var actual   = expressions?.Length;

            if (actual < expected || (!variadic && actual > expected))
            {
                var more   = variadic ? "or more " : "";
                var only   = variadic ? "only " : "";
                var report = actual == 0 ? "none" : $"{only}{actual}";
                var plural = expected > 1 ? "s" : "";

                throw new Exception($"Error: invalid-arity, the function {name} expects {expected} argument{plural} {more}but {report} were supplied.");
            }

            name_        = name;
            expressions_ = expressions;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FunctionService"/> class.
 /// </summary>
 /// <param name="functionRepository">
 /// The function repository.
 /// </param>
 /// <param name="userRepository">
 /// The user repository.
 /// </param>
 /// <param name="functionInRoleRepository">
 /// The function in role repository.
 /// </param>
 /// <param name="userInRoleRepository">
 /// The user in role repository.
 /// </param>
 public FunctionService(IFunctionRepository functionRepository, IUserRepository userRepository, IFunctionInRoleRepository functionInRoleRepository, IUserInRoleRepository userInRoleRepository)
 {
     this.functionRepository = functionRepository;
     this.userRepository = userRepository;
     this.functionInRoleRepository = functionInRoleRepository;
     this.userInRoleRepository = userInRoleRepository;
 }
Esempio n. 8
0
 public ComputingCore(IFunctionRepository function_repository, IDataCellRepository data_cell_repository, ICommandRepository command_repository /*, ICommandManager command_manager*/, IDataFlowLogicsService data_flow_logics_service)
 {
     _functionRepository = function_repository;
     _dataCellRepository = data_cell_repository;
     _commandRepository  = command_repository;
     //_commandManager = command_manager;
     _dataFlowLogicsService = data_flow_logics_service;
 }
        public UserFunctionManager(IUserFunctionRepository userFunctionRepository, IFunctionRepository functionRepository, ITokenManager tokenManager)
        {
            _userFunctionRepository = userFunctionRepository;
            _functionRepository = functionRepository;
            _tokenManager = tokenManager;

            _functions = new Dictionary<FunctionIdentityName, Func<Guid, bool>>();  // No items now
        }
 public MenuFuncService(IMenuRepository menuRepository, IMenuFuncRepository menuFuncRepository,
                        IFunctionRepository functionRepository, IRoleMenuFuncRepository roleMenuFuncRepository)
 {
     _menuRepository         = menuRepository;
     _functionRepository     = functionRepository;
     _menuFuncRepository     = menuFuncRepository;
     _roleMenuFuncRepository = roleMenuFuncRepository;
 }
Esempio n. 11
0
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public VariableRenderer
        (
            IFunctionRepository functionRepository
        )

            : base(functionRepository)
        {
        }
Esempio n. 12
0
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public ContentRenderer
        (
            IFunctionRepository functionRepository
        )

            : base(functionRepository)
        {
        }
Esempio n. 13
0
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public VariableDecrementerRenderer
        (
            IFunctionRepository functionRepository
        )

            : base(functionRepository)
        {
        }
Esempio n. 14
0
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public ModelBindingRenderer
        (
            IFunctionRepository functionRepository
        )

            : base(functionRepository)
        {
        }
Esempio n. 15
0
 public FunctionService(IFunctionRepository functionRepository, RoleManager <AppRole> roleManager, IPermissionRepository permissionRepository, IUnitOfWork unitOfWork, IMapper mapper)
 {
     _functionRepository   = functionRepository;
     _roleManager          = roleManager;
     _permissionRepository = permissionRepository;
     _unitOfWork           = unitOfWork;
     _mapper = mapper;
 }
 public FunctionService(IMapper mapper,
                        IFunctionRepository functionRepository,
                        IUnitOfWork unitOfWork)
 {
     _functionRepository = functionRepository;
     _unitOfWork         = unitOfWork;
     _mapper             = mapper;
 }
        /// <summary>
        /// Constructs the expression evaluator with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public BooleanExpressionEvaluator
        (
            IFunctionRepository functionRepository
        )

            : base(functionRepository)
        {
        }
Esempio n. 18
0
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public FlagRenderer
        (
            IFunctionRepository functionRepository
        )

            : base(functionRepository)
        {
        }
 public RoleService(RoleManager <AppRole> roleManager, IUnitOfWork unitOfWork, IFunctionRepository functionRepository,
                    IPermissionRepository permissionRepository, UserManager <AppUser> userManager)
 {
     this._roleManager          = roleManager;
     this._unitOfWork           = unitOfWork;
     this._functionRepository   = functionRepository;
     this._permissionRepository = permissionRepository;
     this._userManager          = userManager;
 }
Esempio n. 20
0
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public NettleRendererBase
        (
            IFunctionRepository functionRepository
        )
        {
            Validate.IsNotNull(functionRepository);

            this.FunctionRepository = functionRepository;
        }
Esempio n. 21
0
 public FunctionService(
     IFunctionRepository functionRepository,
     IPermissionRepository permissionRepository,
     IUnitOfWork unitOfWork)
 {
     _functionRepository   = functionRepository;
     _permissionRepository = permissionRepository;
     _unitOfWork           = unitOfWork;
 }
Esempio n. 22
0
        /// <summary>
        /// Constructs the template validator with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        public FunctionValidator
        (
            IFunctionRepository functionRepository
        )
        {
            Validate.IsNotNull(functionRepository);

            _functionRepository = functionRepository;
        }
 public SecurityContractDefaultConfigurationService(IRoleRepository roleRepository, IUserRepository userRepository, IFunctionRepository functionRepository, ITeamRepository teamRepository, IApplicationRepository applicationRepository, IApplicationDataPolicyRepository applicationDataPolicyRepository, ILdapAuthenticationModeRepository ldapAuthenticationModeRepository)
 {
     this.roleRepository                   = roleRepository;
     this.userRepository                   = userRepository;
     this.functionRepository               = functionRepository;
     this.teamRepository                   = teamRepository;
     this.applicationRepository            = applicationRepository;
     this.applicationDataPolicyRepository  = applicationDataPolicyRepository;
     this.ldapAuthenticationModeRepository = ldapAuthenticationModeRepository;
 }
Esempio n. 24
0
 public FunctionService(IMapper mapper,
                        IFunctionRepository functionRepository,
                        IConfiguration configuration,
                        IUnitOfWork unitOfWork)
 {
     _configuration      = configuration;
     _functionRepository = functionRepository;
     _unitOfWork         = unitOfWork;
     _mapper             = mapper;
 }
Esempio n. 25
0
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        /// <param name="collectionRenderer">The block collection renderer</param>
        public ForEachLoopRenderer
        (
            IFunctionRepository functionRepository,
            BlockCollectionRenderer collectionRenderer
        )

            : base(functionRepository)
        {
            Validate.IsNotNull(collectionRenderer);

            _collectionRenderer = collectionRenderer;
        }
Esempio n. 26
0
 public InternalService(IUserRepository userRepository,
                        IRoleRepository roleRepository,
                        IFunctionRepository functionRepository,
                        IUserRoleRepository userRoleRepository,
                        IUnitOfWork unitOfWork)
 {
     this._functionRepository = functionRepository;
     this._userRoleRepository = userRoleRepository;
     this._roleRepository     = roleRepository;
     this._userRepository     = userRepository;
     this._unitOfWork         = unitOfWork;
 }
Esempio n. 27
0
 public AccountsController(
     IAccountRepository accountRepository,
     IFunctionRepository functionRepository,
     IGroupRepository groupRepository,
     IWardRepository wardRepository,
     IBaseApiService service) : base(service)
 {
     _accountRepository  = accountRepository;
     _functionRepository = functionRepository;
     _groupRepository    = groupRepository;
     _wardRepository     = wardRepository;
 }
        /// <summary>
        /// Constructs the renderer with required dependencies
        /// </summary>
        /// <param name="functionRepository">The function repository</param>
        /// <param name="expressionEvaluator">The expression evaluator</param>
        public ConditionalBindingRenderer
        (
            IFunctionRepository functionRepository,
            BooleanExpressionEvaluator expressionEvaluator
        )

            : base(functionRepository)
        {
            Validate.IsNotNull(expressionEvaluator);

            _expressionEvaluator = expressionEvaluator;
        }
 public ProjectSettingsAccessService(
     IPrjSettingsRepository prjSettingsRepository,
     IProcessRepository processRepository,
     IFunctionRepository functionRepository,
     IHolidayRepository holidayRepository,
     IWeekdayRepository weekdayRepository)
 {
     this.prjSettingsRepository = prjSettingsRepository;
     this.processRepository     = processRepository;
     this.functionRepository    = functionRepository;
     this.holidayRepository     = holidayRepository;
     this.weekdayRepository     = weekdayRepository;
 }
Esempio n. 30
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     _entityContext.Database.Connection.Close();
     _CrashRepository        = null;
     _buggRepository         = null;
     _functionRepository     = null;
     _userRepository         = null;
     _callstackRepository    = null;
     _userGroupRepository    = null;
     _errorMessageRepository = null;
     _entityContext.Dispose();
     _entityContext = null;
 }
Esempio n. 31
0
 public PermissionService(IPermissionRepository permissionRepository,
                          IFunctionRepository functionRepository,
                          UserManager <AppUser> userManager,
                          RoleManager <AppRole> roleManager,
                          IConfiguration configuration,
                          IUnitOfWork unitOfWork)
 {
     _configuration             = configuration;
     _userManager               = userManager;
     _roleManager               = roleManager;
     _functionRepository        = functionRepository;
     this._permissionRepository = permissionRepository;
     this._unitOfWork           = unitOfWork;
 }
Esempio n. 32
0
        public CommandManager(IFunctionRepository function_repository, IDataCellRepository data_cell_repository, IJobManager job_manager, ICommandRepository command_repository, ICommandService command_service)
        {
            _dataCellRepository     = data_cell_repository;
            _functionRepository     = function_repository;
            _jobManager             = job_manager;
            _jobManager.OnReliseJob = OnReliseJob;
            _commandRepository      = command_repository;
            _commandService         = command_service;

            _commandHeaders = new ConcurrentQueue <CommandHeader>();
            _readyCommands  = new ConcurrentQueue <Command>();

            _commandRepository.Subscribe(null, OnNewCommand);
        }
        public FunctionalGroupModelCreator(IUserTypeRepository userTypeRepository, IFunctionRepository functionRepository)
        {
            _userTypeRepository = userTypeRepository;
            _functionRepository = functionRepository;

            dictionary = new Dictionary<UserType, Func<IEnumerable<FunctionStorageModel>, IEnumerable<GroupFunctionStorageModel>>>
            {
                {UserType.ClinicUser, GetFunctionsForClinicUser},
                {UserType.HospitalUser, GetFunctionsForHospitalUser},
                {UserType.Administrator, GetFunctionsForAdministratorUser},
                {UserType.Bot, GetFunctionsForBotUser},
                {UserType.Reviewer, GetFunctionsForReviewerUser},
                {UserType.ReceptionUser, GetFunctionsForReceptionUser}
            };
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PermissionService"/> class.
 /// </summary>
 /// <param name="functionRepository">
 /// The function repository.
 /// </param>
 /// <param name="securityDomainService">
 /// The security domain service.
 /// </param>
 /// <param name="functionInRoleRepository">
 /// The function in role repository.
 /// </param>
 public PermissionService(IFunctionRepository functionRepository, ISecurityDomainService securityDomainService, IFunctionInRoleRepository functionInRoleRepository)
 {
     this.functionRepository = functionRepository;
     this.securityDomainService = securityDomainService;
     this.functionInRoleRepository = functionInRoleRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SecurityDomainService"/> class.
 /// </summary>
 /// <param name="functionInRoleRepository">
 /// The function in role repository.
 /// </param>
 /// <param name="roleRepository">
 /// The role repository.
 /// </param>
 /// <param name="functionRepository">
 /// The function repository.
 /// </param>
 public SecurityDomainService(IFunctionInRoleRepository functionInRoleRepository, IRoleRepository roleRepository, IFunctionRepository functionRepository)
 {
     this.functionInRoleRepository = functionInRoleRepository;
     this.roleRepository = roleRepository;
     this.functionRepository = functionRepository;
 }
Esempio n. 36
0
 public ActionController()
 {
     this.unitOfWork = new UnitOfWork();
     this.repository = RepositoryFactory.GetRepository<IFunctionRepository, Function>(this.unitOfWork);
 }
Esempio n. 37
0
 public SessionService(IFunctionRepository functionRepository, IUserFunctionManager userFunctionManager)
 {
     _functionRepository = functionRepository;
     _userFunctionManager = userFunctionManager;
 }
Esempio n. 38
0
 public SecurityJsonFilterAttribute()
 {
     this.unitOfWork = new UnitOfWork();
     this.repository = RepositoryFactory.GetRepository<IFunctionRepository, Function>(this.unitOfWork);
 }