private static object GetSettingsContainer(ITrayKitPlugin plugin) { var pluginType = plugin.GetType(); var settingsContainerProperty = pluginType.GetProperties().Where(x => Attribute.IsDefined(x, typeof(Base.Settings.TrayKitPluginSettingsContainerAttribute))).FirstOrDefault(); if (settingsContainerProperty == null) { return(null); } var settingsContainerType = settingsContainerProperty.PropertyType; var settingsContainerInstance = pluginType.GetProperty(settingsContainerProperty.Name).GetValue(plugin); return(settingsContainerInstance); }
public static string GetPluginAssemblyName(this ITrayKitPlugin plugin) { return(plugin?.GetType().Assembly.GetName().Name); }
public static Assembly GetPluginAssembly(this ITrayKitPlugin plugin) { return(plugin?.GetType().Assembly); }