public override void StartOperations(Vault vaultPersistent)
        {
            BackgroundDispatcher = new BackgroundDispatcher <TSecureConfiguration>(this);

            EventDispatcher = new EventDispatcher <TSecureConfiguration>(this);

            ValidatorDispatcher = new ValidatorDispatcher <TSecureConfiguration>(this);

            if (this.GetType().IsDefined(typeof(UseLicensingAttribute)))
            {
                var content = License?.Content <LicenseContentBase>();

                BackgroundDispatcher = new LicensedDispatcher(BackgroundDispatcher, content);

                EventDispatcher = new LicensedDispatcher(EventDispatcher, content);

                ValidatorDispatcher = new LicensedDispatcher <IEnumerable <ValidationFinding> >(ValidatorDispatcher, content);
            }

            BackgroundDispatcher.IncludeAssemblies(IncludeAssemblies());
            EventDispatcher.IncludeAssemblies(IncludeAssemblies());
            ValidatorDispatcher.IncludeAssemblies(IncludeAssemblies());

            base.StartOperations(vaultPersistent);
        }
        protected override IEnumerable <ValidationFinding> CustomValidation(Vault vault, TSecureConfiguration config)
        {
            ValidationResults = new ConcurrentDictionary <Type, ValidationResults>();

            var command = new ValidationCommand(vault);

            var customCommand = AddCustomValidationCommand(vault);

            var findings = ValidatorDispatcher.Dispatch(command, customCommand);

            if (findings == null)
            {
                return(base.CustomValidation(vault, config));
            }

            return(findings.Concat(base.CustomValidation(vault, config)));
        }
示例#3
0
        public override void StartOperations(Vault vaultPersistent)
        {
            BackgroundDispatcher = new BackgroundDispatcher <TConfig>(this);

            EventDispatcher = new EventDispatcher <TConfig>(this);

            ValidatorDispatcher = new ValidatorDispatcher <TConfig>(this);

            if (this.GetType().IsDefined(typeof(UseLicensingAttribute)))
            {
                BackgroundDispatcher = new LicensedDispatcher(BackgroundDispatcher, licenseContent);

                EventDispatcher = new LicensedDispatcher(EventDispatcher, licenseContent);

                ValidatorDispatcher = new LicensedDispatcher <IEnumerable <ValidationFinding> >(ValidatorDispatcher, licenseContent);
            }

            //Left out the call to base.StartOperations() for testing purposes.
        }