/// <summary> /// Creates an instance of the described brush and applies it to the layer /// </summary> internal void CreateInstance(Layer layer) { if (layer == null) { throw new ArgumentNullException(nameof(layer)); } if (layer.LayerBrush != null) { throw new ArtemisCoreException("Layer already has an instantiated layer brush"); } BaseLayerBrush brush = (BaseLayerBrush)Provider.Plugin.Kernel !.Get(LayerBrushType); brush.Layer = layer; brush.Descriptor = this; brush.Initialize(); brush.Update(0); layer.LayerBrush = brush; layer.OnLayerBrushUpdated(); if (layer.ShouldBeEnabled) { brush.InternalEnable(); } }
/// <summary> /// Creates an instance of the described brush and applies it to the layer /// </summary> internal void CreateInstance(Layer layer) { if (layer.LayerBrush != null) { throw new ArtemisCoreException("Layer already has an instantiated layer brush"); } BaseLayerBrush brush = (BaseLayerBrush)LayerBrushProvider.PluginInfo.Kernel.Get(LayerBrushType); brush.Layer = layer; brush.Descriptor = this; brush.Initialize(); brush.Update(0); layer.LayerBrush = brush; layer.OnLayerBrushUpdated(); }