Ejemplo n.º 1
0
 public void EndReplace()
 {
     if (document != null)
     {
         Gtk.Application.Invoke(delegate { document.Editor.Document.EndAtomicUndo(); document.Editor.Document.CommitUpdateAll(); });
         return;
     }
     if (buffer != null && somethingReplaced)
     {
         object attributes = DesktopService.GetFileAttributes(FileName);
         File.WriteAllText(FileName, buffer.ToString());
         DesktopService.SetFileAttributes(FileName, attributes);
     }
     buffer = null;
 }
Ejemplo n.º 2
0
 public virtual void EndReplace()
 {
     if (document != null)
     {
         Gtk.Application.Invoke((o, args) => {
             if (undoGroup != null)
             {
                 undoGroup.Dispose();
                 undoGroup = null;
             }
             /*document.Editor.Document.CommitUpdateAll (); */
         });
         return;
     }
     if (buffer != null && somethingReplaced)
     {
         object attributes = DesktopService.GetFileAttributes(FileName);
         TextFileUtility.WriteText(FileName, buffer.ToString(), encoding ?? Encoding.UTF8);
         DesktopService.SetFileAttributes(FileName, attributes);
     }
     buffer = null;
 }
Ejemplo n.º 3
0
 public void EndReplace()
 {
     if (document != null)
     {
         Gtk.Application.Invoke(delegate {
             if (undoGroup != null)
             {
                 undoGroup.Dispose();
                 undoGroup = null;
             }
             /*document.Editor.Document.CommitUpdateAll (); */
         });
         return;
     }
     if (buffer != null && somethingReplaced)
     {
         object attributes = DesktopService.GetFileAttributes(FileName);
         TextFileUtility.WriteText(FileName, buffer.ToString(), encoding, hadBom);
         DesktopService.SetFileAttributes(FileName, attributes);
     }
     FileService.NotifyFileChanged(FileName);
     buffer = null;
 }