Ejemplo n.º 1
0
        public static ValidationResults Validate(Activity toValidate, ValidationSettings settings)
        {
            if (toValidate == null)
            {
                throw CoreWf.Internals.FxTrace.Exception.ArgumentNull("toValidate");
            }

            if (settings == null)
            {
                throw CoreWf.Internals.FxTrace.Exception.ArgumentNull("settings");
            }

            if (toValidate.HasBeenAssociatedWithAnInstance)
            {
                throw CoreWf.Internals.FxTrace.Exception.AsError(new InvalidOperationException(SR.RootActivityAlreadyAssociatedWithInstance(toValidate.DisplayName)));
            }

            if (settings.PrepareForRuntime && (settings.SingleLevel || settings.SkipValidatingRootConfiguration || settings.OnlyUseAdditionalConstraints))
            {
                throw CoreWf.Internals.FxTrace.Exception.Argument("settings", SR.InvalidPrepareForRuntimeValidationSettings);
            }

            InternalActivityValidationServices validator = new InternalActivityValidationServices(settings, toValidate);

            return(validator.InternalValidate());
        }
Ejemplo n.º 2
0
 internal InternalActivityValidationServices(ValidationSettings settings, Activity toValidate)
 {
     _settings       = settings;
     _rootToValidate = toValidate;
     _environment    = settings.Environment;
 }
Ejemplo n.º 3
0
 internal InternalActivityValidationServices(ValidationSettings settings, Activity toValidate)
 {
     this.settings       = settings;
     this.rootToValidate = toValidate;
     this.environment    = settings.Environment;
 }