public void Eject(Type pluginType, Instance instance) { var key = new InstanceKey(instance, pluginType); if (!_objects.Has(key)) return; var disposable = _objects[key] as IDisposable; _objects.Remove(key); disposable.SafeDispose(); }
public bool Equals(InstanceKey obj) { if (ReferenceEquals(null, obj)) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } return(Equals(obj.Name, Name) && Equals(obj.PluginType, PluginType)); }
public void Eject(Type pluginType, Instance instance) { var key = new InstanceKey(instance, pluginType); if (!_objects.Has(key)) { return; } var disposable = _objects[key] as IDisposable; _objects.Remove(key); disposable.SafeDispose(); }
public void Set(Type pluginType, Instance instance, object value) { if (value == null) return; try { var key = new InstanceKey(instance, pluginType); _objects[key] = value; } catch (ArgumentException e) { string message = string.Format("Duplicate key for Instance {0} of PluginType {1}", instance.Name, pluginType.AssemblyQualifiedName); throw new ArgumentException(message, e); } }
public void Set(Type pluginType, Instance instance, object value) { if (value == null) { return; } try { var key = new InstanceKey(instance, pluginType); _objects[key] = value; } catch (ArgumentException e) { string message = string.Format("Duplicate key for Instance {0} of PluginType {1}", instance.Name, pluginType.AssemblyQualifiedName); throw new ArgumentException(message, e); } }
public object Get(Type pluginType, Instance instance) { var key = new InstanceKey(instance, pluginType); return(_objects.Has(key) ? _objects[key] : null); }
public bool Has(Type pluginType, Instance instance) { var key = new InstanceKey(instance, pluginType); return(_objects.Has(key)); }
public bool Equals(InstanceKey obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; return Equals(obj.Name, Name) && Equals(obj.PluginType, PluginType); }
public bool Has(Type pluginType, Instance instance) { var key = new InstanceKey(instance, pluginType); return _objects.Has(key); }
public object Get(Type pluginType, Instance instance) { var key = new InstanceKey(instance, pluginType); return _objects.Has(key) ? _objects[key] : null; }