Esempio n. 1
0
        private ConditionType?GetConditionTypeForParameter(
            ICSharpArgumentInfo argumentInfo,
            [CanBeNull] IContractAnnotationFDT contractAnnotationFdt)
        {
            var matchingParameter = argumentInfo.MatchingParameter;

            if (matchingParameter != null)
            {
                var parameter = matchingParameter.Element;

                if (contractAnnotationFdt != null)
                {
                    var conditionType = GetContractAnnotationConditionTypeForParameter(contractAnnotationFdt, parameter);

                    if (conditionType != null)
                    {
                        return(conditionType);
                    }
                }

                return(GetAssertionConditionAnnotationConditionType(parameter));
            }

            return(null);
        }
Esempio n. 2
0
        private ConditionType?GetConditionTypeForParameter(
            ICSharpArgumentInfo argumentInfo,
            [CanBeNull] FunctionDefinitionTable functionDefinitionTable)
        {
            var matchingParameter = argumentInfo.MatchingParameter;

            if (matchingParameter != null)
            {
                var parameter = matchingParameter.Element;

                if (functionDefinitionTable != null)
                {
                    var conditionType = GetContractAnnotationConditionTypeForParameter(functionDefinitionTable, parameter);

                    if (conditionType != null)
                    {
                        return(conditionType);
                    }
                }

                return(GetAssertionConditionAnnotationConditionType(parameter));
            }

            return(null);
        }
 public static IDeclaration GetMatchingArgument(ICSharpArgumentInfo argument)
 {
     var matchingParameter = argument.MatchingParameter;
     if (matchingParameter == null)
         return null;
     var declaredElement = matchingParameter.Element as IDeclaredElement;
     var declaration = declaredElement.GetDeclarations().FirstOrDefault();
     return declaration;
 }
Esempio n. 4
0
 private static bool GetMatchingParameterDeclaration(ICSharpArgumentInfo argument,
     out IRegularParameterDeclaration matchingVarDecl)
 {
     var matchingArgument = TreeNodeHandlerUtil.GetMatchingArgument(argument);
     matchingVarDecl = matchingArgument as IRegularParameterDeclaration;
     if (matchingVarDecl == null)
         return true;
     return false;
 }
Esempio n. 5
0
 private static bool ArgumentNameMatches(ICSharpArgumentInfo argument, string propertyName)
 {
     return(string.Compare(argument.ArgumentName, propertyName, StringComparison.InvariantCultureIgnoreCase) == 0);
 }