diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs index 8f935f1..072c249 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/TempDotNetMicroThreadingCodeInjector.cs | |||
@@ -27,12 +27,9 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.IO; |
31 | using System.Text; | ||
32 | using Rail.Transformation; | ||
33 | using Rail.Reflect; | 31 | using Rail.Reflect; |
34 | using Rail.Exceptions; | 32 | using Rail.Transformation; |
35 | using Rail.MSIL; | ||
36 | 33 | ||
37 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 34 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
38 | { | 35 | { |
@@ -40,25 +37,25 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
40 | /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes! | 37 | /// Tedds Sandbox for RAIL/microtrheading. This class is only for testing purposes! |
41 | /// Its offspring will be the actual implementation. | 38 | /// Its offspring will be the actual implementation. |
42 | /// </summary> | 39 | /// </summary> |
43 | class TempDotNetMicroThreadingCodeInjector | 40 | internal class TempDotNetMicroThreadingCodeInjector |
44 | { | 41 | { |
45 | public static string TestFix(string FileName) | 42 | public static string TestFix(string FileName) |
46 | { | 43 | { |
47 | string ret = System.IO.Path.GetFileNameWithoutExtension(FileName + "_fixed.dll"); | 44 | string ret = Path.GetFileNameWithoutExtension(FileName + "_fixed.dll"); |
48 | 45 | ||
49 | Console.WriteLine("Loading: \"" + FileName + "\""); | 46 | Console.WriteLine("Loading: \"" + FileName + "\""); |
50 | RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName); | 47 | RAssemblyDef rAssembly = RAssemblyDef.LoadAssembly(FileName); |
51 | 48 | ||
52 | 49 | ||
53 | //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe | 50 | //Get the type of the method to copy from assembly Teste2.exe to assembly Teste.exe |
54 | RTypeDef type = (RTypeDef)rAssembly.RModuleDef.GetType("SecondLife.Script"); | 51 | RTypeDef type = (RTypeDef) rAssembly.RModuleDef.GetType("SecondLife.Script"); |
55 | 52 | ||
56 | //Get the methods in the type | 53 | //Get the methods in the type |
57 | RMethod[] m = type.GetMethods(); | 54 | RMethod[] m = type.GetMethods(); |
58 | 55 | ||
59 | //Create a MethodPrologueAdder visitor object with the method to add | 56 | //Create a MethodPrologueAdder visitor object with the method to add |
60 | //and with the flag that enables local variable creation set to true | 57 | //and with the flag that enables local variable creation set to true |
61 | MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef)m[0], true); | 58 | MethodPrologueAdder mpa = new MethodPrologueAdder((RMethodDef) m[0], true); |
62 | 59 | ||
63 | //Apply the changes to the assembly | 60 | //Apply the changes to the assembly |
64 | rAssembly.Accept(mpa); | 61 | rAssembly.Accept(mpa); |
@@ -67,7 +64,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
67 | rAssembly.SaveAssembly(ret); | 64 | rAssembly.SaveAssembly(ret); |
68 | 65 | ||
69 | return ret; | 66 | return ret; |
70 | |||
71 | } | 67 | } |
72 | } | 68 | } |
73 | } | 69 | } \ No newline at end of file |