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