/// <summary> /// Evaluates the violations for the rule. /// </summary> /// <remarks></remarks> public override IEnumerable<ValidationResult> Validate() { List<ValidationResult> errors = new List<ValidationResult>(); // Verify all [Required] and [Import]ed properties have valid values. this.ValidateObject(); // Make initial trace statement for this rule tracer.Info( "Validating $safeitemname$ on current element '{0}' with AProperty '{1}'", this.CurrentElement.InstanceName, this.AProperty); // TODO: Implement provider automation code to determine the violations errors.Add(new ValidationResult( string.Format(CultureInfo.CurrentCulture, "The element '{0}' is not valid in some way. <Some prescriptive action to make it valid.>", this.CurrentElement.InstanceName))); // TODO: Use tracer.Warn() to note expected and recoverable errors // TODO: Use tracer.Verbose() to note internal execution logic decisions // TODO: Use tracer.Info() to note key results of execution // TODO: Raise exceptions for all other errors tracer.Info( "Validated $safeitemname$ on current element '{0}' with AProperty '{1}', as '{2}'", this.CurrentElement.InstanceName, this.AProperty, !errors.Any()); return errors; }