示例#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;
 }
示例#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;
 }
示例#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;
 }