Getting all classes implementing this interface in WinRT

I am trying to get a list of classes that implement a specific interface in applications for storing applications on windows 8, but it seems that WinRT has a lot of reflection, and so far I have not been able to find a good example of this.

Does anyone know how to load the current assembly and skip it?

Any help is much appreciated :)

+8
reflection c # windows-8 windows-store-apps windows-runtime
source share
1 answer

Got a response from MSDN forums. Just post it here if someone is looking for the same.

This code will get all classes implementing the IDisposable interface:

// We get the current assembly through the current class var currentAssembly = this.GetType().GetTypeInfo().Assembly; // we filter the defined classes according to the interfaces they implement var iDisposableAssemblies = currentAssembly.DefinedTypes.Where(type => type.ImplementedInterfaces.Any(inter => inter == typeof(IDisposable))).ToList(); 
+10
source share

All Articles