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

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Jan 26 20:13:03 EST 2004


Author: benm
Date: 2004-01-26 20:13:03 -0500 (Mon, 26 Jan 2004)
New Revision: 665

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
Log:
more stub

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-01-27 01:00:28 UTC (rev 664)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-01-27 01:13:03 UTC (rev 665)
@@ -26,16 +26,33 @@
 		public virtual IViewContent CreateContentForFile (string fileName)
 		{
 			SourceEditorDisplayBindingWrapper w = new SourceEditorDisplayBindingWrapper ();
+			
 			w.Load (fileName);
 		}
 		
 		public virtual IViewContent CreateContentForLanguage (string language, string content)
 		{
+			SourceEditorDisplayBindingWrapper w = new SourceEditorDisplayBindingWrapper ();
+			
+			// HACK HACK
+			if (language == "C#")
+				language = "text/x-csharp";
+			else
+				language = null;
+			
 			w.LoadString (language, content);
 		}
 		
 		public virtual IViewContent CreateContentForLanguage (string language, string content, string new_file_name)
 		{
+			SourceEditorDisplayBindingWrapper w = new SourceEditorDisplayBindingWrapper ();
+			
+			// HACK HACK
+			if (language == "C#")
+				language = "text/x-csharp";
+			else
+				language = null;
+			
 			w.LoadString (language, content);
 		}	
 	}
@@ -46,7 +63,7 @@
 		
 		public override Gtk.Widget Control {
 			get {
-				return textAreaControl;
+				return se;
 			}
 		}
 		
@@ -58,6 +75,7 @@
 		
 		public SourceEditorDisplayBindingWrapper ()
 		{
+			se = new SourceEditor ();
 		}
 		
 		public override void RedrawContent()
@@ -80,6 +98,18 @@
 		
 		public override void Load (string fileName)
 		{
+			if (fileName.EndsWith (".cs"))
+				se.Load (fileName, "text/x-csharp");
+			else
+				se.Load (fileName);
 		}
+		
+		public void LoadString (string mime, string val)
+		{
+			if (mime != null)
+				se.LoadText (val, mime);
+			else
+				se.LoadText (val);
+		}
 	}
 }

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs	2004-01-27 01:00:28 UTC (rev 664)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorWidget.cs	2004-01-27 01:13:03 UTC (rev 665)
@@ -30,12 +30,23 @@
 			LoadText (File.OpenText (file).ReadToEnd (), mime);
 		}
 		
+		
+		public void LoadFile (string file)
+		{
+			sb.Text = File.OpenText (file).ReadToEnd ();
+		}
+		
 		public void LoadText (string text, string mime)
 		{
 			sb.Text = text;
 			sb.Language = slm.GetLanguageFromMimeType (mime);
 		}
 		
+		public void LoadText (string text)
+		{
+			sb.Text = text;
+		}
+		
 		public string Text { get { return sb.Text; } }
 	}
 }
\ No newline at end of file




More information about the Monodevelop-patches-list mailing list