[Gtk-sharp-list] Interface Name Patch

Samuel Kaufman skaufman@elite.net
Tue, 25 May 2004 20:12:54 -0700


--=-4id1yxy/EUodgRIrqEyh
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This patch will make the naming of interfaces consistent within Gtk#,
following the core class library's naming scheme.  (ITheName)

I used the "(this is InterfaceGen)" approach because it was less messy
than making the 'Name' property virtual, making the 'elem' variable
protected, etc.  Either approach should work, though.

--=-4id1yxy/EUodgRIrqEyh
Content-Description: 
Content-Disposition: inline; filename=interface-name.diff
Content-Type: text/x-patch; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: 7bit

Index: GenBase.cs
===================================================================
RCS file: /mono/gtk-sharp/generator/GenBase.cs,v
retrieving revision 1.15
diff -u -r1.15 GenBase.cs
--- GenBase.cs	5 Oct 2003 00:37:24 -0000	1.15
+++ GenBase.cs	26 May 2004 03:01:01 -0000
@@ -41,7 +41,10 @@
 
 		public string Name {
 			get {
-				return elem.GetAttribute ("name");
+				if (this is InterfaceGen)
+					return "I" + elem.GetAttribute ("name");
+				else
+					return elem.GetAttribute ("name");
 			}
 		}
 

--=-4id1yxy/EUodgRIrqEyh--