internal ContractCustomWarningHighlighting(ICSharpStatement statement, CustomWarningValidationResult warning, ValidatedContractBlock contractBlock)
        {
            Contract.Requires(warning != null);
            Contract.Requires(contractBlock != null);
            Contract.Assert(_range != null);

            _range            = statement.GetHighlightingRange();
            _toolTip          = warning.GetErrorText();
            _validationResult = warning;
            _contractBlock    = contractBlock;
            MethodName        = warning.GetEnclosingMethodName();
        }
 internal PreconditionInAsyncMethodHighlighting(ICSharpFunctionDeclaration element, CustomWarningValidationResult warning, ValidatedContractBlock contractBlock)
     : base(element, warning, contractBlock)
 {
 }
        internal LegacyContractCustomWarningHighlighting(ICSharpFunctionDeclaration element, CustomWarningValidationResult warning, ValidatedContractBlock contractBlock)
        {
            Contract.Requires(warning != null);
            Contract.Requires(contractBlock != null);

            _toolTip          = warning.GetErrorText();
            _range            = element.GetHighlightingRange();
            _validationResult = warning;
            _contractBlock    = contractBlock;
            MethodName        = warning.GetEnclosingMethodName();
        }
        internal static LegacyContractCustomWarningHighlighting Create(ICSharpFunctionDeclaration element, CustomWarningValidationResult warning, ValidatedContractBlock contractBlock)
        {
            switch (warning.Warning)
            {
            case MalformedContractCustomWarning.PreconditionInAsyncMethod:
                return(new PreconditionInAsyncMethodHighlighting(element, warning, contractBlock));

            case MalformedContractCustomWarning.PreconditionInMethodWithIteratorBlock:
                return(new PreconditionInMethodWithIteratorBlockHighlighing(element, warning, contractBlock));

            default:
                return(new LegacyContractCustomWarningHighlighting(element, warning, contractBlock));
            }
        }
        internal static ContractCustomWarningHighlighting Create(ICSharpStatement statement, CustomWarningValidationResult warning, ValidatedContractBlock contractBlock)
        {
            switch (warning.Warning)
            {
            case MalformedContractCustomWarning.PreconditionInAsyncMethod:
            case MalformedContractCustomWarning.PreconditionInMethodWithIteratorBlock:
                return(null);

            default:
                return(new ContractCustomWarningHighlighting(statement, warning, contractBlock));
            }
        }