private EditorContentBox MakeNewEditor() { var editor = new EditorContentBox(m_pathResolver); editor.Enter += new EventHandler(OnEditorEntered); editor.Editor.FileDrop += new EventHandler <FileDropEventArgs>(OnFileDropped); editor.FormClosed += new FormClosedEventHandler(OnEditorClosed); editor.Editor.SelectionChanged += new EventHandler(OnEditorSelectionChanged); editor.Show(m_dockPanel); // fire scintilla oncaretchange OnEditorSelectionChanged(editor.Editor, new EventArgs()); return(editor); }
public EditorContentBox AddEditorWindow(string fileName, bool shouldCreate) { var fullFilePath = m_pathResolver.Resolve(fileName); var fileKey = Helpers.NormalizePath(fullFilePath); EditorContentBox editor = null; // Already opened editor if (m_fileEditorMap.ContainsKey(fileKey)) { editor = m_fileEditorMap[fileKey]; } else // Create new editor, load file if given non-null filename { editor = NewEditorWindow(); if (!String.IsNullOrEmpty(fileName)) { editor.LoadFile(fullFilePath, shouldCreate); m_fileEditorMap.Add(fileKey, editor); } } editor.Show(m_dockPanel); return(editor); }