Просмотр исходного кода

2009-01-19 Atsushi Enomoto <[email protected]>

        * CodeLiteral.cs : use Convert.ChangeType() override that is
          available in 2.1.


svn path=/trunk/mcs/; revision=123783
Atsushi Eno 17 лет назад
Родитель
Сommit
cddc74d2cd

+ 5 - 0
mcs/class/System.ServiceModel/Mono.CodeGeneration/ChangeLog

@@ -1,3 +1,8 @@
+2009-01-19  Atsushi Enomoto  <[email protected]>
+
+	* CodeLiteral.cs : use Convert.ChangeType() override that is
+	  available in 2.1.
+
 2009-01-19  Atsushi Enomoto  <[email protected]>
 
 	* CodeModule.cs : use DefineDynamicModule() which is avaiable in 2.1.

+ 2 - 1
mcs/class/System.ServiceModel/Mono.CodeGeneration/CodeLiteral.cs

@@ -22,6 +22,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Reflection;
 using System.Reflection.Emit;
 
@@ -60,7 +61,7 @@ namespace Mono.CodeGeneration
 			}
 			
 			if (value is Enum)
-				value = Convert.ChangeType (value, (value.GetType().UnderlyingSystemType));
+				value = Convert.ChangeType (value, (value.GetType().UnderlyingSystemType), CultureInfo.InvariantCulture);
 			
 			if (value is Type) {
 				gen.Emit (OpCodes.Ldtoken, (Type)value);