public PluginInformation(IPluginStartup startup, Type pluginType) { _attribute = pluginType.GetCustomAttribute <ImpostorPluginAttribute>(); Startup = startup; PluginType = pluginType; }
public PluginInformation(IPluginStartup?startup, Type pluginType) { _attribute = pluginType.GetCustomAttribute <ImpostorPluginAttribute>() !; Dependencies = pluginType.GetCustomAttributes <ImpostorDependencyAttribute>().Select(t => new DependencyInformation(t)).ToList(); Startup = startup; PluginType = pluginType; }
public PluginInformation(IPluginStartup?startup, Type pluginType) { _attribute = pluginType.GetCustomAttribute <ImpostorPluginAttribute>() !; var assembly = pluginType.Assembly; Name = _attribute.Name ?? assembly.GetCustomAttribute <AssemblyTitleAttribute>()?.Title ?? assembly.GetName().Name !; Author = _attribute.Author ?? assembly.GetCustomAttribute <AssemblyCompanyAttribute>()?.Company ?? string.Empty; Version = _attribute.Version ?? assembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? assembly.GetName().Version !.ToString(); Dependencies = pluginType.GetCustomAttributes <ImpostorDependencyAttribute>().Select(t => new DependencyInformation(t)).ToList(); Startup = startup; PluginType = pluginType; }