public static void Remove(LayerEffectRegistration registration) { lock (Registrations) { if (!Registrations.Contains(registration)) { throw new ArtemisCoreException($"Store does not contain layer brush '{registration.LayerEffectDescriptor.DisplayName}'"); } Registrations.Remove(registration); registration.IsInStore = false; } OnLayerEffectRemoved(new LayerEffectStoreEvent(registration)); }
public static LayerEffectRegistration Add(LayerEffectDescriptor descriptor) { LayerEffectRegistration registration; lock (Registrations) { if (Registrations.Any(r => r.LayerEffectDescriptor == descriptor)) { throw new ArtemisCoreException($"Store already contains layer brush '{descriptor.DisplayName}'"); } registration = new LayerEffectRegistration(descriptor, descriptor.LayerEffectProvider.PluginInfo.Instance) { IsInStore = true }; Registrations.Add(registration); } OnLayerEffectAdded(new LayerEffectStoreEvent(registration)); return(registration); }