예제 #1
0
 public static IParameterSymbol DetermineParameter(
     this SemanticModel semanticModel,
     AttributeArgumentSyntax attributeArgument,
     bool allowParams    = false,
     bool allowCandidate = false,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(DetermineParameterHelper.DetermineParameter(attributeArgument, semanticModel, allowParams, allowCandidate, cancellationToken));
 }
예제 #2
0
        /// <summary>
        /// Determines a parameter symbol that matches to the specified attribute argument.
        /// Returns null if not matching parameter is found.
        /// </summary>
        /// <param name="semanticModel"></param>
        /// <param name="attributeArgument"></param>
        /// <param name="allowParams"></param>
        /// <param name="allowCandidate"></param>
        /// <param name="cancellationToken"></param>
        public static IParameterSymbol DetermineParameter(
            this SemanticModel semanticModel,
            AttributeArgumentSyntax attributeArgument,
            bool allowParams    = false,
            bool allowCandidate = false,
            CancellationToken cancellationToken = default)
        {
            if (attributeArgument == null)
            {
                throw new ArgumentNullException(nameof(attributeArgument));
            }

            if (semanticModel == null)
            {
                throw new ArgumentNullException(nameof(semanticModel));
            }

            return(DetermineParameterHelper.DetermineParameter(attributeArgument, semanticModel, allowParams, allowCandidate, cancellationToken));
        }