/// <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))); }
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); }
/// <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))); }