1
WPF에서 리플렉션을 사용하여 프로젝트의 모든 클래스를 찾는 방법은 무엇입니까? 이름이 특정 정규식과 일치하는 것을 얻는 데 관심이 있습니다.WPF 프로젝트에서 모든 클래스 이름 찾기
var assemblies = AppDomain.CurrentDomain.GetAssemblies()
.Where(a => a.GetName().Name.StartsWith("MyCompany"));
var types = from asm in assemblies
from type in asm.GetTypes()
where Regex.IsMatch(type.FullName,"MyRegexp")
select type.Name;
의 라인을 따라
내 프로젝트에서 두 개 이상의 어셈블리를 사용하므로 모든 프로젝트를 반복하는 방법을 알고 싶습니다. 어쨌든, 답변 주셔서 감사합니다! – luvieere
답변을 편집하여 현재 AppDomain에있는 모든 어셈블리를 찾습니다. –