示例#1
0
        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);
                }
            }
        }
示例#2
0
        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);
        }
示例#3
0
 public DeleteLayerAction(Layer layer, LayerCollection layers, int index) : base(layer, layers, index)
 {
     Name = "Delete layer";
 }
示例#4
0
 protected RegionalLayerAction(Layer layer, LayerCollection layers, int index) : base(layer)
 {
     Layers = layers;
     Index  = index;
 }