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 +++++++------ .../Engines/CSharp/Examples/ExportRegionToLSL.cs | 16 +++++----------- 2 files changed, 12 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/ExtensionsScriptModule/Engines/CSharp') 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 diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs index 7ae4658..2d684d1 100644 --- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs +++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs @@ -26,19 +26,13 @@ * */ -using OpenSim.Framework.Console; -using OpenSim.Framework; -using OpenSim.Region.Environment; using OpenSim.Region.Environment.Scenes; -using System.Collections.Generic; -using libsecondlife; - namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples { public class LSLExportScript : IScript { - ScriptInfo script; + private ScriptInfo script; public string Name { @@ -48,11 +42,11 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples public void Initialise(ScriptInfo scriptInfo) { script = scriptInfo; - + script.events.OnPluginConsole += new EventManager.OnPluginConsoleDelegate(ProcessConsoleMsg); } - void ProcessConsoleMsg(string[] args) + private void ProcessConsoleMsg(string[] args) { /*if (args[0].ToLower() == "lslexport") { @@ -79,7 +73,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples }*/ } - string processPrimitiveToString(OpenSim.Region.Environment.Scenes.SceneObjectPart prim) + private string processPrimitiveToString(SceneObjectPart prim) { /*string desc = prim.Description; string name = prim.Name; @@ -97,4 +91,4 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples return ""; } } -} +} \ No newline at end of file -- cgit v1.1