private static bool ContainsArcIMSServer(XmlDocument doc, ArcIMSServerUri uri) { foreach (XmlAttribute oAttr in doc.SelectNodes("//arcimscatalog/@capabilitiesurl")) { if (new ArcIMSServerUri(oAttr.Value).ToString().Equals(uri.ToString())) { return(true); } } return(false); }
private static void AddArcIMSServer(XmlDocument doc, ArcIMSServerUri uri) { XmlElement oWMSRoot = doc.SelectSingleNode("/dappleview/servers/builderentry/builderdirectory[@specialcontainer=\"WMSServers\"]") as XmlElement; XmlElement oBuilderEntry = doc.CreateElement("builderentry"); oWMSRoot.AppendChild(oBuilderEntry); XmlElement oDapCatalog = doc.CreateElement("arcimscatalog"); oDapCatalog.SetAttribute("capabilitiesurl", uri.ToString()); oDapCatalog.SetAttribute("enabled", "true"); oBuilderEntry.AppendChild(oDapCatalog); }
private static void RemoveArcIMSServer(XmlDocument doc, ArcIMSServerUri uri) { foreach (XmlElement oDapCatalog in doc.SelectNodes("/dappleview/servers/builderentry/builderdirectory/builderentry/arcimscatalog")) { if (new ArcIMSServerUri(oDapCatalog.GetAttribute("capabilitiesurl")).ToString().Equals(uri.ToString())) { oDapCatalog.ParentNode.ParentNode.RemoveChild(oDapCatalog.ParentNode); } } }
private static void SetArcIMSServerEnabled(XmlDocument doc, ArcIMSServerUri uri, bool blValue) { foreach (XmlElement oArcIMSCatalog in doc.SelectNodes("/dappleview/servers/builderentry/builderdirectory/builderentry/arcimscatalog")) { if (new ArcIMSServerUri(oArcIMSCatalog.GetAttribute("capabilitiesurl")).ToString().Equals(uri.ToString())) { oArcIMSCatalog.SetAttribute("enabled", blValue.ToString()); } } }