0

저는 INamespaceBody, IClassDeclaration 및 IMethod를 보유하고 있습니다. IMethod에 해당하는 IMethodDeclaration과 IClassDeclaration에 해당하는 IClassBody를 가져오고 싶습니다. 그러나 나는 완전히 손실되고 있습니다 ... 어떻게 이것을 할 수 있습니까?ReSharper SDK를 통해 IMethodDeclaration 객체에 액세스

답변

1

당신은 방금 Body 속성을 호출, IMethodDeclaration IClassDeclaration에서 IClassBody을 얻기에 관해서는

IMethod method = MyGetMethod(); // Your code to get the IMethod. 
// This returns a list of IDeclaration 
var declaration = main.GetDeclarations(); 
IMethodDeclaration methodDeclaration = declaration[0]; 

얻기 위해 주어진 IMethod에() 메소드 GetDeclarations를 호출 할 수 있습니다.