//public static O2MethodStream map_ObjectCreateExpressions(this O2MethodStream o2MethodStream, MethodDeclaration methodDeclaration) public static O2MethodStream map_ObjectCreateExpressions(this O2MethodStream o2MethodStream, INode methodDeclaration) { // map ObjectCreateExpression (just about the same process as for memberReferenceExpressions var objectCreateExpressions = methodDeclaration.iNodes <INode, ObjectCreateExpression>(); foreach (var objectCreateExpression in objectCreateExpressions) { var calledIMethod = o2MethodStream.O2MappedAstData.iMethod(objectCreateExpression); if (calledIMethod != null) { if (o2MethodStream.O2MappedAstData.has_IMethod(calledIMethod)) { o2MethodStream.add_IMethod(calledIMethod); } else { o2MethodStream.add_ExternalIMethod(calledIMethod); } } //else // "Could not resolve iMethod for ObjectCreateExpression".error(); } return(o2MethodStream); }
//public static O2MethodStream map_MemberReferenceExpressions(this O2MethodStream o2MethodStream, MethodDeclaration methodDeclaration) public static O2MethodStream map_MemberReferenceExpressions(this O2MethodStream o2MethodStream, INode methodDeclaration) { var memberReferenceExpressions = methodDeclaration.iNodes <INode, MemberReferenceExpression>(); foreach (var memberReferenceExpression in memberReferenceExpressions) { var calledIMethod = o2MethodStream.O2MappedAstData.iMethod(memberReferenceExpression); if (calledIMethod != null) { if (o2MethodStream.O2MappedAstData.has_IMethod(calledIMethod)) { o2MethodStream.add_IMethod(calledIMethod); } else { o2MethodStream.add_ExternalIMethod(calledIMethod); } } else { o2MethodStream.map_Expression(memberReferenceExpression); } //else // "Could not resolve iMethod for memberReferenceExpression".error(); } return(o2MethodStream); }
public static O2MethodStream map_InvocationExpressions(this O2MethodStream o2MethodStream, INode methodDeclaration) //public static O2MethodStream map_InvocationExpressions(this O2MethodStream o2MethodStream, MethodDeclaration methodDeclaration) { var invocationExpressions = methodDeclaration.iNodes <INode, InvocationExpression>(); foreach (var invocationExpression in invocationExpressions) { var calledIMethod = o2MethodStream.O2MappedAstData.iMethod(invocationExpression); if (calledIMethod != null) { if (o2MethodStream.O2MappedAstData.has_IMethod(calledIMethod)) { o2MethodStream.add_IMethod(calledIMethod); } else { o2MethodStream.add_ExternalIMethod(calledIMethod); } } } return(o2MethodStream); }