Esempio n. 1
0
 public PythonEditor()
 {
     InitializeComponent();
     pyEditor.Dock         = System.Windows.Forms.DockStyle.Fill;
     pyEditor.TextChanged += pyEditor_TextChanged;
     editorHost.Controls.Add(pyEditor);
     DocumentModel = new Documents.ScriptDocumentModel();
     DocumentModel.SaveStateChanged += DocumentModel_SaveStateChanged;
     this.SetTitle("Untitled*");
 }
Esempio n. 2
0
 public void Open(string filename = "")
 {
     if (filename == "")
     {
         using (OpenFileDialog opf = new OpenFileDialog())
         {
             opf.Title  = "Open Script";
             opf.Filter = "Python Scripts (*.py)|*.py";
             if (opf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 DocumentModel = new Documents.ScriptDocumentModel(opf.FileName);
             }
         }
     }
     else
     {
         DocumentModel = new Documents.ScriptDocumentModel(filename);
     }
     pyEditor.OpenFile(DocumentModel.FileName);
     DocumentModel.SaveStateChanged += DocumentModel_SaveStateChanged;
     DocumentModel.IsSaved           = true;
 }