public void Remove(PluginKey key) { if (_plugins.ContainsKey(key)) { _plugins.Remove(key); } }
private IExtensionDescriptor CheckForExtension(Type type) { if (!type.IsSubclassOf(typeof(Extension))) { return(null); } var extensionAttribute = type.GetCustomAttribute(typeof(ExtensionAttribute)) as ExtensionAttribute; if (extensionAttribute == null) { return(null); } var key = new PluginKey(type.Assembly.Location, type.FullName); var metadata = new ExtensionMetadata(); SetPluginMetadata(metadata, extensionAttribute, type); var descriptor = new ExtensionDescriptor(key, metadata, type); return(descriptor); }
private IFigureDescriptor CheckForFigure(Type type) { if (!type.IsSubclassOf(typeof(Figure))) { return(null); } var figureAttribute = type.GetCustomAttribute(typeof(FigureAttribute)) as FigureAttribute; if (figureAttribute == null) { return(null); } var key = new PluginKey(type.Assembly.Location, type.FullName); var metadata = new FigureMetadata(); SetPluginMetadata(metadata, figureAttribute, type); var descriptor = new FigureDescriptor(key, metadata, type); return(descriptor); }
public IPluginDescriptor Get(PluginKey key) { return(_plugins.ContainsKey(key) ? _plugins[key] : null); }
public FigureDescriptor(PluginKey key, IPluginMetadata metadata, Type type) : base(key, metadata) { _type = type; }
public ExtensionDescriptor(PluginKey key, IPluginMetadata metadata, Type type) : base(key, metadata) { _type = type; }