Obecnie próbuję przekonwertować bibliotekę aplikacji Xamarin.iOS na PCL (profil 78). Mam ten kod, który nie zostanie skompilowany:Przenośna biblioteka klasy Refleksja
public static void RegisterAllCommandHandlers(IEnumerable<Assembly> assemblies) {
// Get all types that are concrete classes which implement ICommandHandler
var commandHandlerOpenGenericType = typeof(ICommandHandler<>);
var types = new List<Type>();
foreach (var assembly in assemblies) {
types.AddRange(assembly.GetTypes()
.Where(x => x.IsClass && !x.IsAbstract && x.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == commandHandlerOpenGenericType)));
}
}
Oto obraz błędów kompilatora:
Jak mogę zrobić to samo z nowym refleksji API?
Które platformy pan kierować w swojej PCL? – Markus
@Markus Profile 78 (Xamarin.IOS, Xamarin.Android, .net 4.5, Windows Store, Windows Phone 8 –
Jakie są błędy kompilatora, które otrzymujesz? (Obrazek nie pokazuje błędów kompilatora) – elgonzo