2016-10-25 23:01:42 -07:00
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using MediaBrowser.Model.Reflection;
|
2016-11-03 15:34:16 -07:00
|
|
|
|
using System.Reflection;
|
2016-10-25 23:01:42 -07:00
|
|
|
|
|
2016-11-03 15:34:16 -07:00
|
|
|
|
namespace Emby.Common.Implementations.Reflection
|
2016-10-25 23:01:42 -07:00
|
|
|
|
{
|
|
|
|
|
public class AssemblyInfo : IAssemblyInfo
|
|
|
|
|
{
|
|
|
|
|
public Stream GetManifestResourceStream(Type type, string resource)
|
|
|
|
|
{
|
2016-11-03 15:34:16 -07:00
|
|
|
|
#if NET46
|
2016-10-25 23:01:42 -07:00
|
|
|
|
return type.Assembly.GetManifestResourceStream(resource);
|
2016-11-03 15:34:16 -07:00
|
|
|
|
#endif
|
|
|
|
|
return type.GetTypeInfo().Assembly.GetManifestResourceStream(resource);
|
2016-10-25 23:01:42 -07:00
|
|
|
|
}
|
2016-11-04 01:31:05 -07:00
|
|
|
|
|
|
|
|
|
public string[] GetManifestResourceNames(Type type)
|
|
|
|
|
{
|
|
|
|
|
#if NET46
|
|
|
|
|
return type.Assembly.GetManifestResourceNames();
|
|
|
|
|
#endif
|
|
|
|
|
return type.GetTypeInfo().Assembly.GetManifestResourceNames();
|
|
|
|
|
}
|
2016-11-19 09:51:49 -07:00
|
|
|
|
|
|
|
|
|
public Assembly[] GetCurrentAssemblies()
|
|
|
|
|
{
|
|
|
|
|
return AppDomain.CurrentDomain.GetAssemblies();
|
|
|
|
|
}
|
2016-10-25 23:01:42 -07:00
|
|
|
|
}
|
|
|
|
|
}
|