public void Each <T>(Action <T> action, LayerCollection layers = null) where T : Layer { layers = layers ?? this; for (var i = layers.Count - 1; i >= 0; i--) { if (layers[i] is T) { action((T)layers[i]); } if (layers[i] is GroupLayer) { Each(action, (layers[i] as GroupLayer).Layers); } } }
public void Rasterize(LayerCollection layers, System.Drawing.Size size) { var result = new PixelLayer(Name, size) { Pixels = Render(size).WriteableBitmap(), Parent = Parent }; layers = Parent != null ? Parent.Layers : layers; var index = layers.IndexOf(this); layers.Remove(this); layers.Insert(index, result); }
public DeleteLayerAction(Layer layer, LayerCollection layers, int index) : base(layer, layers, index) { Name = "Delete layer"; }
protected RegionalLayerAction(Layer layer, LayerCollection layers, int index) : base(layer) { Layers = layers; Index = index; }