/// <summary>
        /// Records or fixes an instance of a violation.
        /// </summary>
        /// <param name="addin">The addin being extended.</param>
        /// <param name="ruleName">The name of the rule that triggered the violation.</param>
        /// <param name="violationContext">Context for the violation.</param>
        /// <param name="correctionCallback">Callback which fixes the violation.</param>
        /// <param name="correctionContext">Optional callback context.</param>
        /// <typeparam name="T">The type of the callback context.</typeparam>
        public static void Violation <T>(this StyleCopAddIn addin, System.Enum ruleName, ViolationContext violationContext, CorrectViolationHandler <T> correctionCallback, T correctionContext)
        {
            Param.RequireNotNull(addin, "addin");
            Param.Ignore(ruleName);
            Param.RequireNotNull(violationContext, "violationContext");
            Param.RequireNotNull(correctionCallback, "correctViolationCallback");
            Param.Ignore(correctionContext, "correctViolationContext");

            if (addin.Core.RunContext.AutoFix)
            {
                Rule rule = addin.GetRule(ruleName.ToString());

                if (addin.IsRuleEnabled(CsDocumentWrapper.Wrapper(violationContext.Element.Document), rule.Name) &&
                    !addin.IsRuleSuppressed(ElementWrapper.Wrapper(violationContext.Element), rule))
                {
                    correctionCallback(violationContext, correctionContext);
                }
            }
            else
            {
                addin.AddViolation(violationContext.Element, violationContext.LineNumber, ruleName, violationContext.MessageValues);
            }
        }