public void OpenAnimationDocument(FileInfo file) { var animDoc = new DockAnimationEditor(_project, file.Name, Icons.document_16xLG, file) { 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; } animDoc.Parent = this.DockPanel; _editorDocuments.Add(animDoc); this.DockPanel.AddContent(animDoc); }
private void OpenAnimationDocument(FileInfo file) { var animDoc = new DockAnimationEditor(_project, file.Name, Icons.document_16xLG, file) { Tag = file }; // and if there are, just activate it. foreach (var aDoc in _editorDocuments) { if (aDoc.Tag == file) { this.DockPanel.ActiveContent = aDoc; return; } } animDoc.Enter += AnimationDoc_Enter; _editorDocuments.Add(animDoc); DockPanel.AddContent(animDoc); }