Commit 5fc72461 authored by Vinicius Jarina's avatar Vinicius Jarina
Browse files

Mono-style format.

parent a0e1671c
This diff is collapsed.
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface.Config namespace LuaInterface.Config
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface.Event namespace LuaInterface.Event
...@@ -37,13 +36,12 @@ namespace LuaInterface.Event ...@@ -37,13 +36,12 @@ namespace LuaInterface.Event
{ {
private readonly LuaCore.lua_Debug luaDebug; private readonly LuaCore.lua_Debug luaDebug;
public DebugHookEventArgs(LuaCore.lua_Debug luaDebug) public DebugHookEventArgs (LuaCore.lua_Debug luaDebug)
{ {
this.luaDebug = luaDebug; this.luaDebug = luaDebug;
} }
public LuaCore.lua_Debug LuaDebug public LuaCore.lua_Debug LuaDebug {
{
get { return luaDebug; } get { return luaDebug; }
} }
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface.Event namespace LuaInterface.Event
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface.Event namespace LuaInterface.Event
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface.Event namespace LuaInterface.Event
...@@ -31,12 +30,11 @@ namespace LuaInterface.Event ...@@ -31,12 +30,11 @@ namespace LuaInterface.Event
{ {
private readonly Exception m_Exception; private readonly Exception m_Exception;
public Exception Exception public Exception Exception {
{
get { return m_Exception; } get { return m_Exception; }
} }
public HookExceptionEventArgs(Exception ex) public HookExceptionEventArgs (Exception ex)
{ {
m_Exception = ex; m_Exception = ex;
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
using System.Runtime.Serialization; using System.Runtime.Serialization;
...@@ -34,19 +33,19 @@ namespace LuaInterface.Exceptions ...@@ -34,19 +33,19 @@ namespace LuaInterface.Exceptions
[Serializable] [Serializable]
public class LuaException : Exception public class LuaException : Exception
{ {
public LuaException() public LuaException ()
{ {
} }
public LuaException(string message) : base(message) public LuaException (string message) : base(message)
{ {
} }
public LuaException(string message, Exception innerException) : base(message, innerException) public LuaException (string message, Exception innerException) : base(message, innerException)
{ {
} }
protected LuaException(SerializationInfo info, StreamingContext context) : base(info, context) protected LuaException (SerializationInfo info, StreamingContext context) : base(info, context)
{ {
} }
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface.Exceptions namespace LuaInterface.Exceptions
...@@ -36,6 +35,7 @@ namespace LuaInterface.Exceptions ...@@ -36,6 +35,7 @@ namespace LuaInterface.Exceptions
/// Returns true if the exception has occured as the result of a .NET exception in user code /// Returns true if the exception has occured as the result of a .NET exception in user code
/// </summary> /// </summary>
public bool IsNetException { get; private set; } public bool IsNetException { get; private set; }
private readonly string source; private readonly string source;
/// <summary> /// <summary>
...@@ -48,7 +48,7 @@ namespace LuaInterface.Exceptions ...@@ -48,7 +48,7 @@ namespace LuaInterface.Exceptions
/// </summary> /// </summary>
/// <param name="message">The message that describes the error.</param> /// <param name="message">The message that describes the error.</param>
/// <param name="source">The position in the script where the exception was triggered.</param> /// <param name="source">The position in the script where the exception was triggered.</param>
public LuaScriptException(string message, string source) : base(message) public LuaScriptException (string message, string source) : base(message)
{ {
this.source = source; this.source = source;
} }
...@@ -58,17 +58,17 @@ namespace LuaInterface.Exceptions ...@@ -58,17 +58,17 @@ namespace LuaInterface.Exceptions
/// </summary> /// </summary>
/// <param name="innerException">The .NET exception triggered by user-code.</param> /// <param name="innerException">The .NET exception triggered by user-code.</param>
/// <param name="source">The position in the script where the exception was triggered.</param> /// <param name="source">The position in the script where the exception was triggered.</param>
public LuaScriptException(Exception innerException, string source) public LuaScriptException (Exception innerException, string source)
: base("A .NET exception occured in user-code", innerException) : base("A .NET exception occured in user-code", innerException)
{ {
this.source = source; this.source = source;
this.IsNetException = true; this.IsNetException = true;
} }
public override string ToString() public override string ToString ()
{ {
// Prepend the error source // Prepend the error source
return GetType().FullName + ": " + source + Message; return GetType ().FullName + ": " + source + Message;
} }
} }
} }
\ No newline at end of file
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface.Extensions namespace LuaInterface.Extensions
...@@ -38,7 +37,7 @@ namespace LuaInterface.Extensions ...@@ -38,7 +37,7 @@ namespace LuaInterface.Extensions
/// <returns> /// <returns>
/// <c>true</c> if the specified obj is null; otherwise, <c>false</c>. /// <c>true</c> if the specified obj is null; otherwise, <c>false</c>.
/// </returns> /// </returns>
public static bool IsNull(this object obj) public static bool IsNull (this object obj)
{ {
return (obj == null); return (obj == null);
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface namespace LuaInterface
...@@ -39,15 +38,15 @@ namespace LuaInterface ...@@ -39,15 +38,15 @@ namespace LuaInterface
private ObjectTranslator translator; private ObjectTranslator translator;
private Type klass; private Type klass;
public ClassGenerator(ObjectTranslator translator, Type klass) public ClassGenerator (ObjectTranslator translator, Type klass)
{ {
this.translator = translator; this.translator = translator;
this.klass = klass; this.klass = klass;
} }
public object extractGenerated(KopiLua.Lua.lua_State luaState, int stackPos) public object extractGenerated (KopiLua.Lua.lua_State luaState, int stackPos)
{ {
return CodeGeneration.Instance.GetClassInstance(klass, translator.getTable(luaState, stackPos)); return CodeGeneration.Instance.GetClassInstance (klass, translator.getTable (luaState, stackPos));
} }
} }
} }
\ No newline at end of file
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface namespace LuaInterface
...@@ -39,15 +38,15 @@ namespace LuaInterface ...@@ -39,15 +38,15 @@ namespace LuaInterface
private ObjectTranslator translator; private ObjectTranslator translator;
private Type delegateType; private Type delegateType;
public DelegateGenerator(ObjectTranslator translator, Type delegateType) public DelegateGenerator (ObjectTranslator translator, Type delegateType)
{ {
this.translator = translator; this.translator = translator;
this.delegateType = delegateType; this.delegateType = delegateType;
} }
public object extractGenerated(KopiLua.Lua.lua_State luaState, int stackPos) public object extractGenerated (KopiLua.Lua.lua_State luaState, int stackPos)
{ {
return CodeGeneration.Instance.GetDelegate(delegateType, translator.getFunction(luaState, stackPos)); return CodeGeneration.Instance.GetDelegate (delegateType, translator.getFunction (luaState, stackPos));
} }
} }
} }
\ No newline at end of file
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface namespace LuaInterface
...@@ -33,6 +32,6 @@ namespace LuaInterface ...@@ -33,6 +32,6 @@ namespace LuaInterface
*/ */
public interface ILuaGeneratedType public interface ILuaGeneratedType
{ {
LuaTable __luaInterface_getLuaTable(); LuaTable __luaInterface_getLuaTable ();
} }
} }
\ No newline at end of file
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface namespace LuaInterface
......
This diff is collapsed.
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
using System.Text; using System.Text;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -36,29 +35,29 @@ namespace LuaInterface ...@@ -36,29 +35,29 @@ namespace LuaInterface
{ {
private bool _Disposed; private bool _Disposed;
[CLSCompliantAttribute(false)] [CLSCompliantAttribute(false)]
protected int _Reference; protected int
_Reference;
[CLSCompliantAttribute(false)] [CLSCompliantAttribute(false)]
protected Lua _Interpreter; protected Lua
_Interpreter;
~LuaBase() ~LuaBase ()
{ {
Dispose(false); Dispose (false);
} }
public void Dispose() public void Dispose ()
{ {
Dispose(true); Dispose (true);
GC.SuppressFinalize(this); GC.SuppressFinalize (this);
} }
public virtual void Dispose(bool disposeManagedResources) public virtual void Dispose (bool disposeManagedResources)
{ {
if(!_Disposed) if (!_Disposed) {
{ if (disposeManagedResources) {
if(disposeManagedResources) if (_Reference != 0)
{ _Interpreter.dispose (_Reference);
if(_Reference != 0)
_Interpreter.dispose(_Reference);
} }
_Interpreter = null; _Interpreter = null;
...@@ -66,18 +65,16 @@ namespace LuaInterface ...@@ -66,18 +65,16 @@ namespace LuaInterface
} }
} }
public override bool Equals(object o) public override bool Equals (object o)
{ {
if(o is LuaBase) if (o is LuaBase) {
{
var l = (LuaBase)o; var l = (LuaBase)o;
return _Interpreter.compareRef(l._Reference, _Reference); return _Interpreter.compareRef (l._Reference, _Reference);
} } else
else
return false; return false;
} }
public override int GetHashCode() public override int GetHashCode ()
{ {
return _Reference; return _Reference;
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
using System.Text; using System.Text;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -35,14 +34,14 @@ namespace LuaInterface ...@@ -35,14 +34,14 @@ namespace LuaInterface
{ {
internal LuaCore.lua_CFunction function; internal LuaCore.lua_CFunction function;
public LuaFunction(int reference, Lua interpreter) public LuaFunction (int reference, Lua interpreter)
{ {
_Reference = reference; _Reference = reference;
this.function = null; this.function = null;
_Interpreter = interpreter; _Interpreter = interpreter;
} }
public LuaFunction(LuaCore.lua_CFunction function, Lua interpreter) public LuaFunction (LuaCore.lua_CFunction function, Lua interpreter)
{ {
_Reference = 0; _Reference = 0;
this.function = function; this.function = function;
...@@ -53,54 +52,52 @@ namespace LuaInterface ...@@ -53,54 +52,52 @@ namespace LuaInterface
* Calls the function casting return values to the types * Calls the function casting return values to the types
* in returnTypes * in returnTypes
*/ */
internal object[] call(object[] args, Type[] returnTypes) internal object[] call (object[] args, Type[] returnTypes)
{ {
return _Interpreter.callFunction(this, args, returnTypes); return _Interpreter.callFunction (this, args, returnTypes);
} }
/* /*
* Calls the function and returns its return values inside * Calls the function and returns its return values inside
* an array * an array
*/ */
public object[] Call(params object[] args) public object[] Call (params object[] args)
{ {
return _Interpreter.callFunction(this, args); return _Interpreter.callFunction (this, args);
} }
/* /*
* Pushes the function into the Lua stack * Pushes the function into the Lua stack
*/ */
internal void push(LuaCore.lua_State luaState) internal void push (LuaCore.lua_State luaState)
{ {
if(_Reference != 0) if (_Reference != 0)
LuaLib.lua_getref(luaState, _Reference); LuaLib.lua_getref (luaState, _Reference);
else else
_Interpreter.pushCSFunction(function); _Interpreter.pushCSFunction (function);
} }
public override string ToString() public override string ToString ()
{ {
return "function"; return "function";
} }
public override bool Equals(object o) public override bool Equals (object o)
{ {
if(o is LuaFunction) if (o is LuaFunction) {
{
var l = (LuaFunction)o; var l = (LuaFunction)o;
if(this._Reference != 0 && l._Reference != 0) if (this._Reference != 0 && l._Reference != 0)
return _Interpreter.compareRef(l._Reference, this._Reference); return _Interpreter.compareRef (l._Reference, this._Reference);
else else
return this.function == l.function; return this.function == l.function;
} } else
else
return false; return false;
} }
public override int GetHashCode() public override int GetHashCode ()
{ {
return _Reference != 0 ? _Reference : function.GetHashCode(); return _Reference != 0 ? _Reference : function.GetHashCode ();
} }
} }
} }
\ No newline at end of file
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface namespace LuaInterface
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface namespace LuaInterface
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
using System; using System;
namespace LuaInterface namespace LuaInterface
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment