浏览代码

[cs] Remove @:functionCode from cs.Lib and use haxe instead.

Dan Korostelev 11 年之前
父节点
当前提交
c8ee08b4c5
共有 1 个文件被更改,包括 6 次插入15 次删除
  1. 6 15
      std/cs/Lib.hx

+ 6 - 15
std/cs/Lib.hx

@@ -34,27 +34,21 @@ class Lib
 		Changes the current culture settings to allow a consistent cross-target behavior.
 		Currently the only change made is in regard to the decimal separator, which is always set to "."
 	**/
-	@:functionCode('
-			System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(System.Threading.Thread.CurrentThread.CurrentCulture.Name, true);
-			decimalSeparator = ci.NumberFormat.NumberDecimalSeparator;
-            ci.NumberFormat.NumberDecimalSeparator = ".";
-            System.Threading.Thread.CurrentThread.CurrentCulture = ci;
-	')
 	@:keep public static function applyCultureChanges():Void
 	{
-
+		var ci = new cs.system.globalization.CultureInfo(cs.system.threading.Thread.CurrentThread.CurrentCulture.Name, true);
+		decimalSeparator = ci.NumberFormat.NumberDecimalSeparator;
+		ci.NumberFormat.NumberDecimalSeparator = ".";
+		cs.system.threading.Thread.CurrentThread.CurrentCulture = ci;
 	}
 
 	/**
 		Reverts the culture changes to the default settings.
 	**/
-	@:functionCode('
-		System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(System.Threading.Thread.CurrentThread.CurrentCulture.Name, true);
-		System.Threading.Thread.CurrentThread.CurrentCulture = ci;
-	')
 	public static function revertDefaultCulture():Void
 	{
-
+		var ci = new cs.system.globalization.CultureInfo(cs.system.threading.Thread.CurrentThread.CurrentCulture.Name, true);
+		cs.system.threading.Thread.CurrentThread.CurrentCulture = ci;
 	}
 
 	/**
@@ -83,9 +77,6 @@ class Lib
 
 		This function will not work with Value Types (such as Int, Float, Bool...)
 	**/
-	@:functionCode('
-			throw new haxe.lang.HaxeException("This function cannot be accessed at runtime");
-	')
 	@:extern public static inline function as<T>(obj:Dynamic, cl:Class<T>):T
 	{
 		return untyped __as__(obj, cl);