private void 除图层中全部内容ToolStripMenuItem_Click(object sender, EventArgs e) { List <YTEditTemplate> template = new List <YTEditTemplate>(); foreach (ListViewItem item in this.listView2.Items) { template.Add(item.Tag as YTEditTemplate); } if (template.Count > 0) { EditTemplateManager.DeleteMoreEditTemplate(template); this.listView2.Items.Clear(); } this.除图层中全部内容ToolStripMenuItem.Enabled = false; this.除ToolStripMenuItem.Enabled = false; }
private void 除地图中全部内容ToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("确定删除地图中所有模板?", "组织模板", MessageBoxButtons.YesNo) == DialogResult.Yes) { List <YTEditTemplate> template = new List <YTEditTemplate>(); foreach (KeyValuePair <IFeatureLayer, List <YTEditTemplate> > pair in this.Templates) { template.AddRange(pair.Value); } if (template.Count > 0) { EditTemplateManager.DeleteMoreEditTemplate(template); this.listView2.Items.Clear(); } } }