[Monodevelop-patches-list] r682 - trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Jan 27 13:14:27 EST 2004


Author: benm
Date: 2004-01-27 13:14:27 -0500 (Tue, 27 Jan 2004)
New Revision: 682

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
Log:
dirty handling

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs	2004-01-27 18:00:34 UTC (rev 681)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorBuffer.cs	2004-01-27 18:14:27 UTC (rev 682)
@@ -26,22 +26,26 @@
 		public void LoadFile (string file, string mime)
 		{
 			LoadText (File.OpenText (file).ReadToEnd (), mime);
+			Modified = false;
 		}
 		
 		public void LoadFile (string file)
 		{
 			Text = File.OpenText (file).ReadToEnd ();
+			Modified = false;
 		}
 		
 		public void LoadText (string text, string mime)
 		{
 			Text = text;
 			Language = slm.GetLanguageFromMimeType (mime);
+			Modified = false;
 		}
 		
 		public void LoadText (string text)
 		{
 			Text = text;
+			Modified = false;
 		}
 		
 		public void Save (string fileName)
@@ -49,6 +53,7 @@
 			TextWriter s = new StreamWriter (fileName, false);
 			s.Write (Text);
 			s.Close ();
+			Modified = false;
 		}
 
 #region IClipboardHandler

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-01-27 18:00:34 UTC (rev 681)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-01-27 18:14:27 UTC (rev 682)
@@ -81,6 +81,7 @@
 		public SourceEditorDisplayBindingWrapper ()
 		{
 			se = new SourceEditor ();
+			se.Buffer.ModifiedChanged += new EventHandler (OnModifiedChanged);
 		}
 		
 		public override void RedrawContent()
@@ -91,6 +92,11 @@
 		{
 		}
 		
+		void OnModifiedChanged (object o, EventArgs e)
+		{
+			this.IsDirty = se.Buffer.Modified;
+		}
+		
 		public override bool IsReadOnly {
 			get {
 				return false;




More information about the Monodevelop-patches-list mailing list