public void LoadText(string text, string mime) { if (mime != null) { SourceLanguage lang = SourceViewService.GetLanguageFromMimeType(mime); if (lang != null) { Language = lang; } } using (NoUndo n = new NoUndo(this)) { Text = text; } Modified = false; ScrollToTop(); }
// // NOTE: Text is set to null if the file could not be loaded (i.e. not valid utf8 text // public void LoadText(string text) { if (g_utf8_validate (text, text.Length, IntPtr.Zero)) { using (NoUndo n = new NoUndo (this)) Text = text; } else { using (NoUndo n = new NoUndo (this)) Text = null; } Modified = false; ScrollToTop (); }
public void LoadText (string text, string mime) { if (mime != null) { SourceLanguage lang = SourceViewService.GetLanguageFromMimeType (mime); if (lang != null) Language = lang; } using (NoUndo n = new NoUndo (this)) { Text = text; } Modified = false; ScrollToTop (); }
public void LoadFile(string file) { using (NoUndo n = new NoUndo (this)) { StreamReader sr = System.IO.File.OpenText (file); LoadText(sr.ReadToEnd ()); sr.Close (); } }