public DocumentForm NewDocument() { DocumentForm doc = new DocumentForm(); doc.Text = String.Format(CultureInfo.CurrentCulture, "{0}{1}", NEW_DOCUMENT_TEXT, ++_newDocumentCount); doc.Show(dockPanel); toolIncremental.Searcher.Scintilla = doc.Scintilla; return(doc); }
public DocumentForm OpenFile(string filePath) { try { DocumentForm doc = new DocumentForm(); doc.Scintilla.Text = File.ReadAllText(filePath); doc.Scintilla.UndoRedo.EmptyUndoBuffer(); doc.Scintilla.Modified = false; doc.Text = Path.GetFileName(filePath); doc.FilePath = filePath; doc.Show(dockPanel); toolIncremental.Searcher.Scintilla = doc.Scintilla; return(doc); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(null); } }
public DocumentForm OpenFile(string filePath) { try { DocumentForm doc = new DocumentForm(); //doc.Scintilla.BackColor = Settings1.Default.CodeEditorBackColor; //doc.Scintilla.ForeColor = Settings1.Default.CodeEditorFontColor; //doc.Scintilla.FindReplace.Indicator.Color = Settings1.Default.CodeEditorSelectionColor; if (filePath.Contains(".lua")) { doc.Scintilla.CharAdded += new EventHandler<CharAddedEventArgs>(this.sciDocument_CharAdded); doc.Scintilla.TextDeleted += new EventHandler<TextModifiedEventArgs>(Scintilla_TextDeleted); doc.Scintilla.AutoCompleteAccepted += new EventHandler<AutoCompleteAcceptedEventArgs>(Scintilla_AutoCompleteAccepted); doc.Scintilla.MarkerChanged += new EventHandler<MarkerChangedEventArgs>(Scintilla_MarkerChanged); doc.Scintilla.SelectionChanged += new EventHandler(Scintilla_SelectionChanged); //doc.Scintilla.NativeInterface.UpdateUI += new EventHandler<NativeScintillaEventArgs>(Scintilla_SUpdateUI); doc.Scintilla.IsBraceMatching = true; } doc.Scintilla.UndoRedo.EmptyUndoBuffer(); List<Marker> markers = doc.Scintilla.Markers.GetMarkers(0); if (markers.Count > 0) markers[0].BackColor = Color.OrangeRed; doc.Show(dockPanel); doc.Scintilla.Text = File.ReadAllText(filePath); doc.Scintilla.Modified = false; doc.Text = Path.GetFileName(filePath); doc.FilePath = filePath; if (filePath.Contains(".lua")) { checkIntegrityLuaSceneFileFromV1_14ToV1_15(doc); } doc.Save(); if (this.Mode.Equals("DEBUG")) doc.Scintilla.IsReadOnly = true; else { doc.Scintilla.IsReadOnly = false; foreach (DocumentForm documentForm in dockPanel.Documents) { documentForm.Scintilla.Snippets.List.Clear(); documentForm.Scintilla.Snippets.List.AddRange(this.codeEditorSnippets); } } return doc; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } }
//------------------------------ Change made to scene.lua files (initializeComponents become class method of "scene") public void checkIntegrityLuaSceneFileFromV1_14ToV1_15(DocumentForm doc) { if (doc != null) { string case1ToFind = "function initializeComponents(localGroup)"; string case1ToReplace = "function scene:initializeComponents()\n\t local localGroup = self.view\n"; doc.Scintilla.Text = doc.Scintilla.Text.Replace(case1ToFind, case1ToReplace); //----- string case2ToFind = "initializeComponents(group)"; string case2ToReplace = "self:initializeComponents()"; doc.Scintilla.Text = doc.Scintilla.Text.Replace(case2ToFind, case2ToReplace); } }
private DocumentForm NewDocument() { DocumentForm doc = new DocumentForm(); doc.Text = String.Format(CultureInfo.CurrentCulture, "{0}{1}", NEW_DOCUMENT_TEXT, ++_newDocumentCount); doc.Scintilla.CharAdded += new EventHandler<CharAddedEventArgs>(this.sciDocument_CharAdded); doc.Scintilla.TextDeleted += new EventHandler<TextModifiedEventArgs>(Scintilla_TextDeleted); doc.Scintilla.AutoCompleteAccepted += new EventHandler<AutoCompleteAcceptedEventArgs>(Scintilla_AutoCompleteAccepted); doc.Scintilla.UndoRedo.EmptyUndoBuffer(); doc.Scintilla.Modified = false; doc.Show(dockPanel); return doc; }
public DocumentForm OpenFile(string filePath) { try { DocumentForm doc = new DocumentForm(); doc.Scintilla.Text = File.ReadAllText(filePath); doc.Scintilla.UndoRedo.EmptyUndoBuffer(); doc.Scintilla.Modified = false; doc.Text = Path.GetFileName(filePath); doc.FilePath = filePath; doc.Show(dockPanel); toolIncremental.Searcher.Scintilla = doc.Scintilla; return doc; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } }
public DocumentForm NewDocument() { DocumentForm doc = new DocumentForm(); doc.Text = String.Format(CultureInfo.CurrentCulture, "{0}{1}", NEW_DOCUMENT_TEXT, ++_newDocumentCount); doc.Show(dockPanel); toolIncremental.Searcher.Scintilla = doc.Scintilla; return doc; }