Structure for holding information about a WMS Layer
Esempio n. 1
0
 /// <summary>
 /// Recursive method for checking whether a layername exists
 /// </summary>
 /// <param name="layer"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 private bool LayerExists(Client.WmsServerLayer layer, string name)
 {
     if (name == layer.Name) return true;
     foreach (Client.WmsServerLayer childlayer in layer.ChildLayers)
         if (LayerExists(childlayer, name)) return true;
     return false;
 }
Esempio n. 2
0
 /// <summary>
 /// Recursive method for checking whether a layername exists
 /// </summary>
 /// <param name="layer">layer</param>
 /// <param name="name">name of style</param>
 /// <returns>True of style exists</returns>
 private bool StyleExists(Client.WmsServerLayer layer, string name)
 {
     if (layer.Style.Any(style => name == style.Name))
     {
         return(true);
     }
     return(layer.ChildLayers.Any(childlayer => StyleExists(childlayer, name)));
 }
Esempio n. 3
0
 /// <summary>
 /// Recursive method for checking whether a layername exists
 /// </summary>
 /// <param name="layer">layer</param>
 /// <param name="name">name of style</param>
 /// <returns>True of style exists</returns>
 private bool StyleExists(Client.WmsServerLayer layer, string name)
 {
     foreach (Client.WmsLayerStyle style in layer.Style)
         if (name == style.Name) return true;
     foreach (Client.WmsServerLayer childlayer in layer.ChildLayers)
         if (StyleExists(childlayer, name)) return true;
     return false;
 }
Esempio n. 4
0
        private bool FindLayer(Client.WmsServerLayer layer, string name, out Client.WmsServerLayer result)
        {
            result = layer;
            if (name == layer.Name)
            {
                return true;
            }

            foreach (Client.WmsServerLayer childlayer in layer.ChildLayers)
            {
                if (FindLayer(childlayer, name, out result))
                    return true;
            }
            return false;
        }
Esempio n. 5
0
 /// <summary>
 /// Recursive method for checking whether a layername exists
 /// </summary>
 /// <param name="layer"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 private bool LayerExists(Client.WmsServerLayer layer, string name)
 {
     return(name == layer.Name || layer.ChildLayers.Any(childlayer => LayerExists(childlayer, name)));
 }