public static void Remove(LayerBrushRegistration registration) { lock (Registrations) { if (!Registrations.Contains(registration)) { throw new ArtemisCoreException($"Store does not contain layer brush '{registration.LayerBrushDescriptor.DisplayName}'"); } Registrations.Remove(registration); registration.IsInStore = false; } OnLayerBrushRemoved(new LayerBrushStoreEvent(registration)); }
public static LayerBrushRegistration Add(LayerBrushDescriptor descriptor) { LayerBrushRegistration registration; lock (Registrations) { if (Registrations.Any(r => r.LayerBrushDescriptor == descriptor)) { throw new ArtemisCoreException($"Store already contains layer brush '{descriptor.DisplayName}'"); } registration = new LayerBrushRegistration(descriptor, descriptor.LayerBrushProvider.PluginInfo.Instance) { IsInStore = true }; Registrations.Add(registration); } OnLayerBrushAdded(new LayerBrushStoreEvent(registration)); return(registration); }