FindLayer() public method

Returns an enumerable for all layers containing the search parameter in the LayerName property
public FindLayer ( string layername ) : IEnumerable
layername string Search parameter
return IEnumerable
Exemplo n.º 1
0
        public void FindLayer_ReturnEnumerable()
        {
            Map map = new Map();
            map.Layers.Add(new VectorLayer("Layer 1"));
            map.Layers.Add(new VectorLayer("Layer 3"));
            map.Layers.Add(new VectorLayer("Layer 2"));
            map.Layers.Add(new VectorLayer("Layer 4"));

            int count = 0;
            foreach (ILayer lay in map.FindLayer("Layer 3"))
            {
                Assert.AreEqual("Layer 3", lay.LayerName);
                count++;
            }
            Assert.AreEqual(1, count);
        }