2012-04-27 13 views

答えて

3

すべてのクラスのすべてのメソッドをループし、GetCustomAttributes(typeof(DllImportAttribute))が何かを返すかどうかをチェックします。

3
assembly.GetTypes() 
     .SelectMany(t => t.GetMethods(flags)) 
     .Where(m => Attribute.GetCustomAttribute(m, typeof(DllImportAttribute)) != null); 
+0

@SLAKs: – SLaks

+0

が絶対必要です!更新しました。ありがとうございました – abatishchev

関連する問題