From 67e12b95ea7b68f4904a7484d77ecfd787d16d0c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 30 Oct 2007 09:05:31 +0000 Subject: * Optimized usings * Shortened type references * Removed redundant 'this' qualifier --- .../Engines/CSharp/CSharpScriptEngine.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs') diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs index d4b27fc..176fc7b 100644 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs +++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp return ".cs"; } - private Dictionary LoadDotNetScript(CodeDomProvider compiler, string filename) + private Dictionary LoadDotNetScript(CodeDomProvider compiler, string filename) { CompilerParameters compilerParams = new CompilerParameters(); CompilerResults compilerResults; @@ -66,15 +66,16 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp } else { - Dictionary scripts = new Dictionary(); - + Dictionary scripts = new Dictionary(); + foreach (Type pluginType in compilerResults.CompiledAssembly.GetExportedTypes()) { Type testInterface = pluginType.GetInterface("IScript", true); if (testInterface != null) { - IScript script = (IScript)compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString()); + IScript script = + (IScript) compilerResults.CompiledAssembly.CreateInstance(pluginType.ToString()); string scriptName = "C#/" + script.Name; Console.WriteLine("Script: " + scriptName + " loaded."); @@ -94,10 +95,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp return null; } - public Dictionary compile(string filename) + public Dictionary compile(string filename) { CSharpCodeProvider csharpProvider = new CSharpCodeProvider(); return LoadDotNetScript(csharpProvider, filename); } } -} +} \ No newline at end of file -- cgit v1.1