mirror of
https://github.com/opensim/opensim.git
synced 2026-06-24 15:25:46 +08:00
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
This commit is contained in:
@@ -40,7 +40,7 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
|
||||
return ".cs";
|
||||
}
|
||||
|
||||
private Dictionary<string,IScript> LoadDotNetScript(CodeDomProvider compiler, string filename)
|
||||
private Dictionary<string, IScript> LoadDotNetScript(CodeDomProvider compiler, string filename)
|
||||
{
|
||||
CompilerParameters compilerParams = new CompilerParameters();
|
||||
CompilerResults compilerResults;
|
||||
@@ -66,15 +66,16 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
|
||||
}
|
||||
else
|
||||
{
|
||||
Dictionary<string,IScript> scripts = new Dictionary<string,IScript>();
|
||||
|
||||
Dictionary<string, IScript> scripts = new Dictionary<string, IScript>();
|
||||
|
||||
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<string,IScript> compile(string filename)
|
||||
public Dictionary<string, IScript> compile(string filename)
|
||||
{
|
||||
CSharpCodeProvider csharpProvider = new CSharpCodeProvider();
|
||||
return LoadDotNetScript(csharpProvider, filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user