public static bool IsContainerCall(this ITreeNode node, string containerClrTypeName)
{
var invocationExpression = node as IInvocationExpression;
if (invocationExpression == null)
{
return false;
}
var resolve = invocationExpression.InvocationExpressionReference.Resolve().Result;
var method = resolve.DeclaredElement as IMethod;
if (method == null)
{
return false;
}
ITypeElement containingType = method.GetContainingType();
if (containingType == null)
{
return false;
}
IDeclaredType containerClrType = CreateTypeByClrName(node, containerClrTypeName);
return containingType.IsDescendantOf(containerClrType.GetTypeElement());
}