Exemplo n.º 1
0
        /// <summary>
        /// Gets all photocopiers, which in ( layer and children )'s style manager.
        /// </summary>
        /// <param name="layerages"> The layerages. </param>
        /// <returns> The yield photocopiers. </returns>
        public static IEnumerable <Photocopier> GetPhotocopiers(IEnumerable <Layerage> layerages)
        {
            foreach (Layerage layerage in layerages)
            {
                ILayer layer = layerage.Self;

                foreach (Photocopier photocopier in LayerageCollection.GetPhotocopiers(layerage.Children))
                {
                    yield return(photocopier);
                }

                //ImageLayer
                if (layer.Type == LayerType.Image)
                {
                    ImageLayer imageLayer = (ImageLayer)layer;
                    yield return(imageLayer.Photocopier);
                }

                //Fill
                if (layer.Style.Fill.Type == BrushType.Image)
                {
                    yield return(layer.Style.Fill.Photocopier);
                }
                //Stroke
                if (layer.Style.Stroke.Type == BrushType.Image)
                {
                    yield return(layer.Style.Stroke.Photocopier);
                }
            }
        }