private PluginInfo PreparePluginInfo(ILightShellPlugin plugin) { var companyAttribute = plugin.GetType().Assembly.GetCustomAttribute <AssemblyCompanyAttribute>(); return(new PluginInfo { Name = plugin.PluginName, Version = plugin.GetType().Assembly.GetName().Version, Vendor = companyAttribute == null ? "N/A" : companyAttribute.Company, FilePath = plugin.GetType().Assembly.Location, PluginStructure = new[] { new PluginStructureElement { Name = "Plugin structure", Children = new[] { new PluginStructureElement { Name = "Microservices", Children = (plugin.GetMicroservices() ?? Enumerable.Empty <IMicroservice>()) .Select(m => new PluginStructureElement { Name = m.GetType().Name }) }, new PluginStructureElement { Name = "Menu entries", Children = (plugin.GetMenuEntries() ?? Enumerable.Empty <MenuEntryDescriptor>()) .SelectMany(m => m.Buttons.Select(b => new PluginStructureElement { Name = string.Format("{0} » {1} » {2}", m.Tab, m.ButtonsGroupName, b.Label) })) }, } } } }); }
public NewPluginFoundMessage(ILightShellPlugin pluginDescription) { PluginDescription = pluginDescription; }