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); }
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; }
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; }
private static bool ArgumentNameMatches(ICSharpArgumentInfo argument, string propertyName) { return(string.Compare(argument.ArgumentName, propertyName, StringComparison.InvariantCultureIgnoreCase) == 0); }