private void CreateErrorHandlers(IWebUtilityWrapper webUtilityWrapper)
        {
            var types = _reflection.GetTypesFromAssembly("Wizardsgroup.Core.Web");
            var globalExceptionHandlers = _reflection.GetTypesWithImplementingInterface <IGlobalExceptionHandler>(types);

            _handlers = new List <IGlobalExceptionHandler>();
            foreach (var handler in globalExceptionHandlers)
            {
                _handlers.Add(_reflection.CreateInstanceOfType <IGlobalExceptionHandler>(handler, webUtilityWrapper));
            }
        }
예제 #2
0
        private ILookupFunction _CreateInstanceOfLookUp(Type type)
        {
            ILookupFunction instance;

            try
            {
                instance = _helper.CreateInstanceOfType <ILookupFunction>(type, _unitOfWork);
            }
            catch (Exception)
            {
                instance = new NullCustomLookup();
            }

            return(instance);
        }
예제 #3
0
        public override IValidator CreateInstance(Type validatorType)
        {
            var typeInGenericArgs  = validatorType.GetGenericArguments();
            var validatorAttribute = (from type in typeInGenericArgs
                                      let attributeToCheck =
                                          type.GetCustomAttributes(typeof(ValidatorAttribute), true).FirstOrDefault()
                                          let validationAttr = attributeToCheck as ValidatorAttribute
                                                               where validationAttr != null
                                                               select validationAttr).FirstOrDefault();

            if (validatorAttribute != null)
            {
                var validatorTypeToCreate = validatorAttribute.ValidatorType;
                var validatorInstance     = _reflectionHelper.CreateInstanceOfType <IValidator>(validatorTypeToCreate, _unitOfWorkFunc);
                return(validatorInstance);
            }
            return(null);
        }
예제 #4
0
        private IDataDictionarySeeder CreateIntanceOfDataDictionarySeeder(Type gridBuilder)
        {
            var seeders = _reflectionHelper.CreateInstanceOfType <IDataDictionarySeeder>(gridBuilder);

            return(seeders);
        }
예제 #5
0
        private IHistoryInserter CreateIntanceOfHistoryInserter(Type historyInserterType, IContext context)
        {
            var historyInserter = _reflectionHelper.CreateInstanceOfType <IHistoryInserter>(historyInserterType, context);

            return(historyInserter);
        }
예제 #6
0
        public ILookupValueField Create(Type type, string value, string id)
        {
            var lookUp = _helper.CreateInstanceOfType <ILookupValueField>(type, value, id);

            return(lookUp);
        }
예제 #7
0
        private IBuildGridSchema CreateIntanceOfRuleType(Type gridBuilder)
        {
            var gridInstance = _reflectionHelper.CreateInstanceOfType <IBuildGridSchema>(gridBuilder);

            return(gridInstance);
        }