void CreateDocumentWindow(string filename) { string extension = Path.GetExtension(filename).ToLower(); DockContent doc; switch (extension) { case ".py": doc = new TextEditor.CodeView(this, filename, new TextEditor.PythonHighlightStyle()); break; case ".cs": doc = new TextEditor.CodeView(this, filename, new TextEditor.CSharpHighlightStyle()); break; case ".txt": doc = new TextEditor.CodeView(this, filename, new TextEditor.TextStyle()); break; case ".ika-sprite": SpriteEditor.SpriteDocument sprite = new rho.SpriteEditor.SpriteDocument(filename); doc = new SpriteEditor.SpriteEditor(sprite); break; default: MessageBox.Show("rho", String.Format("Unrecognized File type \"{0}\"", extension)); return; } doc.Text = System.IO.Path.GetFileName(filename); doc.Show(dockManager); }
void NewScript(object o, EventArgs e) { TextEditor.CodeView codeview = new TextEditor.CodeView(this, new TextEditor.PythonHighlightStyle()); codeview.MdiParent = this; codeview.Show(); }