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 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface.Config
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface.Event
......@@ -37,13 +36,12 @@ namespace LuaInterface.Event
{
private readonly LuaCore.lua_Debug luaDebug;
public DebugHookEventArgs(LuaCore.lua_Debug luaDebug)
public DebugHookEventArgs (LuaCore.lua_Debug luaDebug)
{
this.luaDebug = luaDebug;
}
public LuaCore.lua_Debug LuaDebug
{
public LuaCore.lua_Debug LuaDebug {
get { return luaDebug; }
}
}
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface.Event
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface.Event
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface.Event
......@@ -31,12 +30,11 @@ namespace LuaInterface.Event
{
private readonly Exception m_Exception;
public Exception Exception
{
public Exception Exception {
get { return m_Exception; }
}
public HookExceptionEventArgs(Exception ex)
public HookExceptionEventArgs (Exception ex)
{
m_Exception = ex;
}
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
using System.Runtime.Serialization;
......@@ -34,19 +33,19 @@ namespace LuaInterface.Exceptions
[Serializable]
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 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
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
/// </summary>
public bool IsNetException { get; private set; }
private readonly string source;
/// <summary>
......@@ -48,7 +48,7 @@ namespace LuaInterface.Exceptions
/// </summary>
/// <param name="message">The message that describes the error.</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;
}
......@@ -58,17 +58,17 @@ namespace LuaInterface.Exceptions
/// </summary>
/// <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>
public LuaScriptException(Exception innerException, string source)
public LuaScriptException (Exception innerException, string source)
: base("A .NET exception occured in user-code", innerException)
{
this.source = source;
this.IsNetException = true;
}
public override string ToString()
public override string ToString ()
{
// Prepend the error source
return GetType().FullName + ": " + source + Message;
return GetType ().FullName + ": " + source + Message;
}
}
}
\ No newline at end of file
......@@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface.Extensions
......@@ -38,7 +37,7 @@ namespace LuaInterface.Extensions
/// <returns>
/// <c>true</c> if the specified obj is null; otherwise, <c>false</c>.
/// </returns>
public static bool IsNull(this object obj)
public static bool IsNull (this object obj)
{
return (obj == null);
}
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface
......@@ -39,15 +38,15 @@ namespace LuaInterface
private ObjectTranslator translator;
private Type klass;
public ClassGenerator(ObjectTranslator translator, Type klass)
public ClassGenerator (ObjectTranslator translator, Type klass)
{
this.translator = translator;
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 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface
......@@ -39,15 +38,15 @@ namespace LuaInterface
private ObjectTranslator translator;
private Type delegateType;
public DelegateGenerator(ObjectTranslator translator, Type delegateType)
public DelegateGenerator (ObjectTranslator translator, Type delegateType)
{
this.translator = translator;
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 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface
......@@ -33,6 +32,6 @@ namespace LuaInterface
*/
public interface ILuaGeneratedType
{
LuaTable __luaInterface_getLuaTable();
LuaTable __luaInterface_getLuaTable ();
}
}
\ No newline at end of file
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface
......
This diff is collapsed.
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
using System.Text;
using System.Collections.Generic;
......@@ -36,29 +35,29 @@ namespace LuaInterface
{
private bool _Disposed;
[CLSCompliantAttribute(false)]
protected int _Reference;
protected int
_Reference;
[CLSCompliantAttribute(false)]
protected Lua _Interpreter;
protected Lua
_Interpreter;
~LuaBase()
~LuaBase ()
{
Dispose(false);
Dispose (false);
}
public void Dispose()
public void Dispose ()
{
Dispose(true);
GC.SuppressFinalize(this);
Dispose (true);
GC.SuppressFinalize (this);
}
public virtual void Dispose(bool disposeManagedResources)
public virtual void Dispose (bool disposeManagedResources)
{
if(!_Disposed)
{
if(disposeManagedResources)
{
if(_Reference != 0)
_Interpreter.dispose(_Reference);
if (!_Disposed) {
if (disposeManagedResources) {
if (_Reference != 0)
_Interpreter.dispose (_Reference);
}
_Interpreter = null;
......@@ -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;
return _Interpreter.compareRef(l._Reference, _Reference);
}
else
return _Interpreter.compareRef (l._Reference, _Reference);
} else
return false;
}
public override int GetHashCode()
public override int GetHashCode ()
{
return _Reference;
}
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
using System.Text;
using System.Collections.Generic;
......@@ -35,14 +34,14 @@ namespace LuaInterface
{
internal LuaCore.lua_CFunction function;
public LuaFunction(int reference, Lua interpreter)
public LuaFunction (int reference, Lua interpreter)
{
_Reference = reference;
this.function = null;
_Interpreter = interpreter;
}
public LuaFunction(LuaCore.lua_CFunction function, Lua interpreter)
public LuaFunction (LuaCore.lua_CFunction function, Lua interpreter)
{
_Reference = 0;
this.function = function;
......@@ -53,54 +52,52 @@ namespace LuaInterface
* Calls the function casting return values to the types
* 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
* 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
*/
internal void push(LuaCore.lua_State luaState)
internal void push (LuaCore.lua_State luaState)
{
if(_Reference != 0)
LuaLib.lua_getref(luaState, _Reference);
if (_Reference != 0)
LuaLib.lua_getref (luaState, _Reference);
else
_Interpreter.pushCSFunction(function);
_Interpreter.pushCSFunction (function);
}
public override string ToString()
public override string ToString ()
{
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;
if(this._Reference != 0 && l._Reference != 0)
return _Interpreter.compareRef(l._Reference, this._Reference);
if (this._Reference != 0 && l._Reference != 0)
return _Interpreter.compareRef (l._Reference, this._Reference);
else
return this.function == l.function;
}
else
} else
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 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface
......
......@@ -22,7 +22,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
namespace LuaInterface
......
......@@ -23,7 +23,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
using System;
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