Fix Linq
This commit is contained in:
parent
dcca0d35aa
commit
3e79c9de17
1 changed files with 5 additions and 6 deletions
|
@ -36,11 +36,10 @@ namespace Ryujinx.HLE.HOS.Services.Sm
|
||||||
|
|
||||||
_registeredServices = new ConcurrentDictionary<string, KPort>();
|
_registeredServices = new ConcurrentDictionary<string, KPort>();
|
||||||
|
|
||||||
_services = AppDomain.CurrentDomain.GetAssemblies()
|
_services = Assembly.GetExecutingAssembly().GetTypes()
|
||||||
.SelectMany(type => type.GetTypes())
|
.SelectMany(type => type.GetCustomAttributes(typeof(ServiceAttribute), true)
|
||||||
.SelectMany(type => type.GetCustomAttributes(typeof(ServiceAttribute), true)
|
.Select(service => (((ServiceAttribute)service).Name, type)))
|
||||||
.Select(service => (((ServiceAttribute)service).Name, type)))
|
.ToDictionary(service => service.Name, service => service.type);
|
||||||
.ToDictionary(service => service.Name, service => service.type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InitializePort(Horizon system)
|
public static void InitializePort(Horizon system)
|
||||||
|
@ -88,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm
|
||||||
{
|
{
|
||||||
if (_services.TryGetValue(name, out Type type))
|
if (_services.TryGetValue(name, out Type type))
|
||||||
{
|
{
|
||||||
ServiceAttribute serviceAttribute = (ServiceAttribute)type.GetCustomAttributes().First(service => ((ServiceAttribute)service).Name == name);
|
ServiceAttribute serviceAttribute = (ServiceAttribute)type.GetCustomAttributes(typeof(ServiceAttribute)).First(service => ((ServiceAttribute)service).Name == name);
|
||||||
|
|
||||||
session.ClientSession.Service = serviceAttribute.Parameter != null ? (IpcService)Activator.CreateInstance(type, context, serviceAttribute.Parameter)
|
session.ClientSession.Service = serviceAttribute.Parameter != null ? (IpcService)Activator.CreateInstance(type, context, serviceAttribute.Parameter)
|
||||||
: (IpcService)Activator.CreateInstance(type, context);
|
: (IpcService)Activator.CreateInstance(type, context);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue