[Monodevelop-patches-list] r2144 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Internal/Serialization

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Jan 16 19:18:30 EST 2005


Author: lluis
Date: 2005-01-16 19:18:30 -0500 (Sun, 16 Jan 2005)
New Revision: 2144

Modified:
   trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
   trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Serialization/ItemProperty.cs
Log:
2005-01-17  Lluis Sanchez Gual  <lluis at novell.com>

	* Internal/Serialization/ItemProperty.cs: Added workaround for a bug
	in mono 1.0 (enum values are encoded as ints in attributes).



Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog	2005-01-16 23:27:09 UTC (rev 2143)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog	2005-01-17 00:18:30 UTC (rev 2144)
@@ -1,3 +1,8 @@
+2005-01-17  Lluis Sanchez Gual  <lluis at novell.com>
+
+	* Internal/Serialization/ItemProperty.cs: Added workaround for a bug
+	in mono 1.0 (enum values are encoded as ints in attributes).
+
 2005-01-14  Christian Hergert <chris at mosaix.net>
 
 	* Commands/FileCommands.cs: Added a Close All menu item.

Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Serialization/ItemProperty.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Serialization/ItemProperty.cs	2005-01-16 23:27:09 UTC (rev 2143)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Serialization/ItemProperty.cs	2005-01-17 00:18:30 UTC (rev 2144)
@@ -89,7 +89,12 @@
 		}
 		
 		public object DefaultValue {
-			get { return defaultValue; }
+			get {
+				// Workaround for a bug in mono 1.0 (enum values are encoded as ints in attributes)
+				if (defaultValue != null && propType != null && propType.IsEnum && !(propType.IsInstanceOfType (defaultValue)))
+					defaultValue = Enum.ToObject (propType, defaultValue);
+				return defaultValue;
+			}
 			set { CheckReadOnly (); defaultValue = value; }
 		}
 		




More information about the Monodevelop-patches-list mailing list