internal void RemoveSourceMap(SourceMap sourceMap) { Layer layer2 = this.layers.Find((Layer layer) => layer.Contains(sourceMap)); layer2.Remove(sourceMap); }
private void layerTreeView_DragDrop(object sender, DragEventArgs e) { TreeView treeView = (TreeView)sender; try { if (e.Data.GetDataPresent(dataTypeName, true)) { TreeNode treeNode = (TreeNode)e.Data.GetData(dataTypeName); TreeNode treeNode2 = ((LayerControls)treeView.Tag).currentDropHighlight; if (treeNode2 != null) { D.Assert(treeView.Tag == this, "Not currently designed to support drags from one layer control to another."); if (treeNode2.Tag == treeNode.Tag) { D.Sayf(0, "Ignoring drop onto self", new object[0]); } else { if (treeNode.Tag is SourceMap) { SourceMap sourceMap = (SourceMap)treeNode.Tag; Layer layer = (Layer)treeNode.Parent.Tag; if (treeNode2.Tag is Layer) { Layer layer2 = (Layer)treeNode2.Tag; layer.Remove(sourceMap); layer2.AddAt(sourceMap, 0); } else { if (treeNode2.Tag is SourceMap) { SourceMap targetSourceMap = (SourceMap)treeNode2.Tag; Layer layer3 = (Layer)treeNode2.Parent.Tag; layer.Remove(sourceMap); int index = layer3.GetIndexOfSourceMap(targetSourceMap) + 1; layer3.AddAt(sourceMap, index); } else { D.Assert(false, "unknown case"); } } object tag = layerTreeView.SelectedNode.Tag; Reload(); IEnumerator enumerator = layerTreeView.Nodes.GetEnumerator(); try { while (enumerator.MoveNext()) { TreeNode treeNode3 = (TreeNode)enumerator.Current; if (treeNode3.Tag == tag) { layerTreeView.SelectedNode = treeNode3; break; } } goto IL_226; } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } if (treeNode.Tag is Layer) { Layer layer4 = (Layer)treeNode.Tag; if (!(treeNode2.Tag is Layer)) { return; } Layer layer5 = (Layer)treeNode2.Tag; if (layer5 == layer4) { return; } _mashup.layerList.Remove(layer4); _mashup.layerList.AddAfter(layer4, layer5); Reload(); } else { D.Assert(false, "didn't think tree could contain anything else"); } } IL_226: treeNode2.EnsureVisible(); } } } finally { ((LayerControls)treeView.Tag).SetDropHighlight(null); } }