예제 #1
0
        private void InitServices()
        {
            _provisionService  = new StandardSSOMProvisionService();
            _validationService = new SSOMValidationService();

            // TODO, setup a high level validation registration
            _provisionService.PreDeploymentServices.Add(new DefaultRequiredPropertiesValidationService());

            var ssomStandartAsm = typeof(ContactFieldControlModelHandler).Assembly;

            foreach (var handlerType in ReflectionUtils.GetTypesFromAssembly <ModelHandlerBase>(ssomStandartAsm))
            {
                _provisionService.RegisterModelHandler(Activator.CreateInstance(handlerType) as ModelHandlerBase);
            }

            var ssomStandartValidationAsm = typeof(ImageRenditionDefinitionValidator).Assembly;

            foreach (var handlerType in ReflectionUtils.GetTypesFromAssembly <ModelHandlerBase>(ssomStandartValidationAsm))
            {
                _validationService.RegisterModelHandler(Activator.CreateInstance(handlerType) as ModelHandlerBase);
            }

            _provisionService.OnModelNodeProcessing += (sender, args) =>
            {
                ContainerTraceUtils.WriteLine(
                    string.Format("Processing: [{0}/{1}] - [{2:0} %] - [{3}] [{4}]",
                                  new object[] {
                    args.ProcessedModelNodeCount,
                    args.TotalModelNodeCount,
                    100d * (double)args.ProcessedModelNodeCount / (double)args.TotalModelNodeCount,
                    args.CurrentNode.Value.GetType().Name,
                    args.CurrentNode.Value
                }));
            };

            _provisionService.OnModelNodeProcessed += (sender, args) =>
            {
                ContainerTraceUtils.WriteLine(
                    string.Format("Processed: [{0}/{1}] - [{2:0} %] - [{3}] [{4}]",
                                  new object[] {
                    args.ProcessedModelNodeCount,
                    args.TotalModelNodeCount,
                    100d * (double)args.ProcessedModelNodeCount / (double)args.TotalModelNodeCount,
                    args.CurrentNode.Value.GetType().Name,
                    args.CurrentNode.Value
                }));
            };

            foreach (var modelHandler in _provisionService.ModelHandlers.Values)
            {
                var isQA = modelHandler.GetType()
                           .GetProperty("IsQARun", BindingFlags.NonPublic | BindingFlags.Instance);

                if (isQA != null)
                {
                    isQA.SetValue(modelHandler, true);;
                }
            }
        }
예제 #2
0
        private void InitServices()
        {
            _provisionService  = new SSOMProvisionService();
            _validationService = new SSOMValidationService();

            var ssomStandartAsm = typeof(ContactFieldControlModelHandler).Assembly;

            foreach (var handlerType in ReflectionUtils.GetTypesFromAssembly <ModelHandlerBase>(ssomStandartAsm))
            {
                _provisionService.RegisterModelHandler(Activator.CreateInstance(handlerType) as ModelHandlerBase);
            }

            var ssomStandartValidationAsm = typeof(SiteFeedWebPartDefinitionValidator).Assembly;

            foreach (var handlerType in ReflectionUtils.GetTypesFromAssembly <ModelHandlerBase>(ssomStandartValidationAsm))
            {
                _validationService.RegisterModelHandler(Activator.CreateInstance(handlerType) as ModelHandlerBase);
            }
        }
예제 #3
0
        private void InitServices()
        {
            _provisionService  = new SSOMProvisionService();
            _validationService = new SSOMValidationService();

            // TODO, setup a high level validation registration
            _provisionService.PreDeploymentServices.Add(new DefaultRequiredPropertiesValidationService());

            var ssomStandartAsm = typeof(ContactFieldControlModelHandler).Assembly;

            foreach (var handlerType in ReflectionUtils.GetTypesFromAssembly <ModelHandlerBase>(ssomStandartAsm))
            {
                _provisionService.RegisterModelHandler(Activator.CreateInstance(handlerType) as ModelHandlerBase);
            }

            var ssomStandartValidationAsm = typeof(ImageRenditionDefinitionValidator).Assembly;

            foreach (var handlerType in ReflectionUtils.GetTypesFromAssembly <ModelHandlerBase>(ssomStandartValidationAsm))
            {
                _validationService.RegisterModelHandler(Activator.CreateInstance(handlerType) as ModelHandlerBase);
            }
        }