public void updateListView() { this.bListViewClicked = false; availLayersView.Items.Clear(); if (msLm != null) { for (int i = 0; i < msLm.LayerCount; i++) { MSLayer concreteLayer = msLm.getLayer(i); ListViewItem lItem = new ListViewItem(concreteLayer.Title); availLayersView.Items.Add(lItem); availLayersView.Items[i].Checked = concreteLayer.Visible; } } this.bListViewClicked = true; }
private void fillDialogWithData(MapServerLayer layer) { if (layer.IsUptodate) { this.layerTabControl.Controls.Add(this.layerTab); this.layerTabControl.Controls.Add(this.infoTab); this.bListViewClicked = false; availLayersView.Clear(); this.availLayersView.Columns.Add("Name", 120, HorizontalAlignment.Left); msLm = layer.ConcreteLayer.LayerManager; for (int i = 0; i < msLm.LayerCount; i++) { MSLayer concreteLayer = msLm.getLayer(i); ListViewItem lItem = new ListViewItem(concreteLayer.Title); availLayersView.Items.Add(lItem); availLayersView.Items[i].Checked = concreteLayer.Visible; } this.bListViewClicked = true; layerNameTextBox.Text = currentLayer.LayerName; layerCommentTextBox.Text = currentLayer.Comment; msServer.Text = currentLayer.MapserverURL; // build tree this.infoTree.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { new TreeNode("Server"), new TreeNode("Dienste"), new TreeNode("Layer") }); infoTree.Nodes[0].Nodes.Add("Name: " + currentLayer.ConcreteLayer.Name); infoTree.Nodes[0].Nodes.Add("Title: " + currentLayer.ConcreteLayer.Title); infoTree.Nodes[0].Nodes.Add("Abstract: " + currentLayer.ConcreteLayer.AbstractDesc); infoTree.Nodes[0].Nodes.Add("Kontakt: " + currentLayer.ConcreteLayer.ContactInfo); infoTree.Nodes[1].Nodes.AddRange(new System.Windows.Forms.TreeNode[] { new TreeNode("Anfragen"), new TreeNode("Ausnahmen"), new TreeNode("Benutzermöglichkeiten") }); if (currentLayer.ConcreteLayer.Capabilities.GetCapabilitiesEnabled) { infoTree.Nodes[1].Nodes[0].Nodes.Add("GetCapabilities"); } if (currentLayer.ConcreteLayer.Capabilities.GetMapEnabled) { infoTree.Nodes[1].Nodes[0].Nodes.Add("GetMap"); } if (currentLayer.ConcreteLayer.Capabilities.GetFeatureInfoEnabled) { infoTree.Nodes[1].Nodes[0].Nodes.Add("GetFeatureInfo"); } if (currentLayer.ConcreteLayer.Capabilities.DescribeLayerEnabled) { infoTree.Nodes[1].Nodes[0].Nodes.Add("DescribeLayer"); } if (currentLayer.ConcreteLayer.Capabilities.GetLegendGraphicEnabled) { infoTree.Nodes[1].Nodes[0].Nodes.Add("GetLegendGraphic"); } if (currentLayer.ConcreteLayer.Capabilities.GetStylesEnabled) { infoTree.Nodes[1].Nodes[0].Nodes.Add("GetStyles"); } } }