private void OpenMapDocument(FileInfo file) { var mapDoc = new DockMapDocument(file.Name, Icons.document_16xLG, file, _project, _dockTilesetTools, _dockLayers, _dockMapObject, _dockMapAttributes) { Tag = file }; // Make sure there isn't already an open document of this file foreach (var mDoc in _editorDocuments) { if (mDoc.Tag == file) { this.DockPanel.ActiveContent = mDoc; return; } } mapDoc.Enter += MapDoc_Enter; _editorDocuments.Add(mapDoc); DockPanel.AddContent(mapDoc); }
private void OpenMapDocument(FileInfo file) { var mapDoc = new DockMapDocument(file.Name, Icons.document_16xLG, file, _project, _dockTilesetTools, _dockLayers, _dockMapObject, _dockMapAttributes) { Tag = file }; // Make sure there isn't already an open document of this file var existingDoc = this.FindOpenDocument(file); if (existingDoc != null) { this.DockPanel.ActiveContent = existingDoc; return; } mapDoc.Enter += MapDoc_Enter; mapDoc.VisibleChanged += MapDoc_VisibleChanged; mapDoc.Closed += MapDoc_Closed; mapDoc.Parent = this.DockPanel; _editorDocuments.Add(mapDoc); this.DockPanel.AddContent(mapDoc); }