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

Mono-style format.

parent a0e1671c
...@@ -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
......
...@@ -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
......
This diff is collapsed.
...@@ -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;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
......
...@@ -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
......
...@@ -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.Reflection; using System.Reflection;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
...@@ -38,24 +37,22 @@ namespace LuaInterface ...@@ -38,24 +37,22 @@ namespace LuaInterface
/// </summary> /// </summary>
/// <param name="lua">The Lua VM to add the methods to</param> /// <param name="lua">The Lua VM to add the methods to</param>
/// <param name="o">The object to get the methods from</param> /// <param name="o">The object to get the methods from</param>
public static void TaggedInstanceMethods(Lua lua, object o) public static void TaggedInstanceMethods (Lua lua, object o)
{ {
#region Sanity checks #region Sanity checks
if(lua.IsNull()) if (lua.IsNull ())
throw new ArgumentNullException("lua"); throw new ArgumentNullException ("lua");
if(o.IsNull()) if (o.IsNull ())
throw new ArgumentNullException("o"); throw new ArgumentNullException ("o");
#endregion #endregion
foreach(var method in o.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public)) foreach (var method in o.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public)) {
{ foreach (LuaGlobalAttribute attribute in method.GetCustomAttributes(typeof(LuaGlobalAttribute), true)) {
foreach(LuaGlobalAttribute attribute in method.GetCustomAttributes(typeof(LuaGlobalAttribute), true)) if (string.IsNullOrEmpty (attribute.Name))
{ lua.RegisterFunction (method.Name, o, method); // CLR name
if(string.IsNullOrEmpty(attribute.Name))
lua.RegisterFunction(method.Name, o, method); // CLR name
else else
lua.RegisterFunction(attribute.Name, o, method); // Custom name lua.RegisterFunction (attribute.Name, o, method); // Custom name
} }
} }
} }
...@@ -67,27 +64,25 @@ namespace LuaInterface ...@@ -67,27 +64,25 @@ namespace LuaInterface
/// </summary> /// </summary>
/// <param name="lua">The Lua VM to add the methods to</param> /// <param name="lua">The Lua VM to add the methods to</param>
/// <param name="type">The class type to get the methods from</param> /// <param name="type">The class type to get the methods from</param>
public static void TaggedStaticMethods(Lua lua, Type type) public static void TaggedStaticMethods (Lua lua, Type type)
{ {
#region Sanity checks #region Sanity checks
if(lua.IsNull()) if (lua.IsNull ())
throw new ArgumentNullException("lua"); throw new ArgumentNullException ("lua");
if(type.IsNull()) if (type.IsNull ())
throw new ArgumentNullException("type"); throw new ArgumentNullException ("type");
if(!type.IsClass) if (!type.IsClass)
throw new ArgumentException("The type must be a class!", "type"); throw new ArgumentException ("The type must be a class!", "type");
#endregion #endregion
foreach(var method in type.GetMethods(BindingFlags.Static | BindingFlags.Public)) foreach (var method in type.GetMethods(BindingFlags.Static | BindingFlags.Public)) {
{ foreach (LuaGlobalAttribute attribute in method.GetCustomAttributes(typeof(LuaGlobalAttribute), false)) {
foreach(LuaGlobalAttribute attribute in method.GetCustomAttributes(typeof(LuaGlobalAttribute), false)) if (string.IsNullOrEmpty (attribute.Name))
{ lua.RegisterFunction (method.Name, null, method); // CLR name
if(string.IsNullOrEmpty(attribute.Name))
lua.RegisterFunction(method.Name, null, method); // CLR name
else else
lua.RegisterFunction(attribute.Name, null, method); // Custom name lua.RegisterFunction (attribute.Name, null, method); // Custom name
} }
} }
} }
...@@ -100,26 +95,25 @@ namespace LuaInterface ...@@ -100,26 +95,25 @@ namespace LuaInterface
/// <typeparam name="T">The enum type to register</typeparam> /// <typeparam name="T">The enum type to register</typeparam>
/// <param name="lua">The Lua VM to add the enum to</param> /// <param name="lua">The Lua VM to add the enum to</param>
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "The type parameter is used to select an enum type")] [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "The type parameter is used to select an enum type")]
public static void Enumeration<T>(Lua lua) public static void Enumeration<T> (Lua lua)
{ {
#region Sanity checks #region Sanity checks
if(lua.IsNull()) if (lua.IsNull ())
throw new ArgumentNullException("lua"); throw new ArgumentNullException ("lua");
#endregion #endregion
var type = typeof(T); var type = typeof(T);
if(!type.IsEnum) if (!type.IsEnum)
throw new ArgumentException("The type must be an enumeration!"); throw new ArgumentException ("The type must be an enumeration!");
string[] names = Enum.GetNames(type); string[] names = Enum.GetNames (type);
var values = (T[])Enum.GetValues(type); var values = (T[])Enum.GetValues (type);
lua.NewTable(type.Name); lua.NewTable (type.Name);
for(int i = 0; i < names.Length; i++) for (int i = 0; i < names.Length; i++) {
{ string path = type.Name + "." + names [i];
string path = type.Name + "." + names[i]; lua [path] = values [i];
lua[path] = values[i];
} }
} }
#endregion #endregion
......
...@@ -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; using System.Collections;
...@@ -40,7 +39,7 @@ namespace LuaInterface ...@@ -40,7 +39,7 @@ namespace LuaInterface
*/ */
public class LuaTable : LuaBase public class LuaTable : LuaBase
{ {
public LuaTable(int reference, Lua interpreter) public LuaTable (int reference, Lua interpreter)
{ {
_Reference = reference; _Reference = reference;
_Interpreter = interpreter; _Interpreter = interpreter;
...@@ -49,63 +48,55 @@ namespace LuaInterface ...@@ -49,63 +48,55 @@ namespace LuaInterface
/* /*
* Indexer for string fields of the table * Indexer for string fields of the table
*/ */
public object this[string field] public object this [string field] {
{ get {
get return _Interpreter.getObject (_Reference, field);
{
return _Interpreter.getObject(_Reference, field);
} }
set set {
{ _Interpreter.setObject (_Reference, field, value);
_Interpreter.setObject(_Reference, field, value);
} }
} }
/* /*
* Indexer for numeric fields of the table * Indexer for numeric fields of the table
*/ */
public object this[object field] public object this [object field] {
{ get {
get return _Interpreter.getObject (_Reference, field);
{
return _Interpreter.getObject(_Reference, field);
} }
set set {
{ _Interpreter.setObject (_Reference, field, value);
_Interpreter.setObject(_Reference, field, value);
} }
} }
public System.Collections.IDictionaryEnumerator GetEnumerator() public System.Collections.IDictionaryEnumerator GetEnumerator ()
{ {
return _Interpreter.GetTableDict(this).GetEnumerator(); return _Interpreter.GetTableDict (this).GetEnumerator ();
} }
public ICollection Keys public ICollection Keys {
{ get { return _Interpreter.GetTableDict (this).Keys; }
get { return _Interpreter.GetTableDict(this).Keys; }
} }
public ICollection Values public ICollection Values {
{ get { return _Interpreter.GetTableDict (this).Values; }
get { return _Interpreter.GetTableDict(this).Values; }
} }
/* /*
* Gets an string fields of a table ignoring its metatable, * Gets an string fields of a table ignoring its metatable,
* if it exists * if it exists
*/ */
internal object rawget(string field) internal object rawget (string field)
{ {
return _Interpreter.rawGetObject(_Reference, field); return _Interpreter.rawGetObject (_Reference, field);
} }
internal object rawgetFunction(string field) internal object rawgetFunction (string field)
{ {
object obj = _Interpreter.rawGetObject(_Reference, field); object obj = _Interpreter.rawGetObject (_Reference, field);
if(obj is LuaCore.lua_CFunction) if (obj is LuaCore.lua_CFunction)
return new LuaFunction((LuaCore.lua_CFunction)obj, _Interpreter); return new LuaFunction ((LuaCore.lua_CFunction)obj, _Interpreter);
else else
return obj; return obj;
} }
...@@ -113,12 +104,12 @@ namespace LuaInterface ...@@ -113,12 +104,12 @@ namespace LuaInterface
/* /*
* Pushes this table into the Lua stack * Pushes this table into the Lua stack
*/ */
internal void push(LuaCore.lua_State luaState) internal void push (LuaCore.lua_State luaState)
{ {
LuaLib.lua_getref(luaState, _Reference); LuaLib.lua_getref (luaState, _Reference);
} }
public override string ToString() public override string ToString ()
{ {
return "table"; return "table";
} }
......
...@@ -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;
...@@ -33,7 +32,7 @@ namespace LuaInterface ...@@ -33,7 +32,7 @@ namespace LuaInterface
public class LuaUserData : LuaBase public class LuaUserData : LuaBase
{ {
public LuaUserData(int reference, Lua interpreter) public LuaUserData (int reference, Lua interpreter)
{ {
_Reference = reference; _Reference = reference;
_Interpreter = interpreter; _Interpreter = interpreter;
...@@ -42,30 +41,24 @@ namespace LuaInterface ...@@ -42,30 +41,24 @@ namespace LuaInterface
/* /*
* Indexer for string fields of the userdata * Indexer for string fields of the userdata
*/ */
public object this[string field] public object this [string field] {
{ get {
get return _Interpreter.getObject (_Reference, field);
{
return _Interpreter.getObject(_Reference, field);
} }
set set {
{ _Interpreter.setObject (_Reference, field, value);
_Interpreter.setObject(_Reference, field, value);
} }
} }
/* /*
* Indexer for numeric fields of the userdata * Indexer for numeric fields of the userdata
*/ */
public object this[object field] public object this [object field] {
{ get {
get return _Interpreter.getObject (_Reference, field);
{
return _Interpreter.getObject(_Reference, field);
} }
set set {
{ _Interpreter.setObject (_Reference, field, value);
_Interpreter.setObject(_Reference, field, value);
} }
} }
...@@ -73,20 +66,20 @@ namespace LuaInterface ...@@ -73,20 +66,20 @@ namespace LuaInterface
* Calls the userdata and returns its return values inside * Calls the userdata 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 userdata into the Lua stack * Pushes the userdata into the Lua stack
*/ */
internal void push(LuaCore.lua_State luaState) internal void push (LuaCore.lua_State luaState)
{ {
LuaLib.lua_getref(luaState, _Reference); LuaLib.lua_getref (luaState, _Reference);
} }
public override string ToString() public override string ToString ()
{ {
return "userdata"; return "userdata";
} }
......
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.Diagnostics; using System.Diagnostics;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -34,28 +33,28 @@ namespace LuaInterface.Method ...@@ -34,28 +33,28 @@ namespace LuaInterface.Method
/// </summary> /// </summary>
class EventHandlerContainer : IDisposable class EventHandlerContainer : IDisposable
{ {
private Dictionary<Delegate, RegisterEventHandler> dict = new Dictionary<Delegate, RegisterEventHandler>(); private Dictionary<Delegate, RegisterEventHandler> dict = new Dictionary<Delegate, RegisterEventHandler> ();
public void Add(Delegate handler, RegisterEventHandler eventInfo) public void Add (Delegate handler, RegisterEventHandler eventInfo)
{ {
dict.Add(handler, eventInfo); dict.Add (handler, eventInfo);
} }
public void Remove(Delegate handler) public void Remove (Delegate handler)
{ {
bool found = dict.Remove(handler); bool found = dict.Remove (handler);
Debug.Assert(found); Debug.Assert (found);
} }
/// <summary> /// <summary>
/// Remove any still registered handlers /// Remove any still registered handlers
/// </summary> /// </summary>
public void Dispose() public void Dispose ()
{ {
foreach(KeyValuePair<Delegate, RegisterEventHandler> pair in dict) foreach (KeyValuePair<Delegate, RegisterEventHandler> pair in dict)
pair.Value.RemovePending(pair.Key); pair.Value.RemovePending (pair.Key);
dict.Clear(); dict.Clear ();
} }
} }
} }
\ 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.Method namespace LuaInterface.Method
...@@ -39,11 +38,11 @@ namespace LuaInterface.Method ...@@ -39,11 +38,11 @@ namespace LuaInterface.Method
* Gets the function called name from the provided table, * Gets the function called name from the provided table,
* returning null if it does not exist * returning null if it does not exist
*/ */
public static LuaFunction getTableFunction(LuaTable luaTable, string name) public static LuaFunction getTableFunction (LuaTable luaTable, string name)
{ {
object funcObj = luaTable.rawget(name); object funcObj = luaTable.rawget (name);
if(funcObj is LuaFunction) if (funcObj is LuaFunction)
return (LuaFunction)funcObj; return (LuaFunction)funcObj;
else else
return null; return null;
...@@ -52,29 +51,25 @@ namespace LuaInterface.Method ...@@ -52,29 +51,25 @@ namespace LuaInterface.Method
/* /*
* Calls the provided function with the provided parameters * Calls the provided function with the provided parameters
*/ */
public static object callFunction(LuaFunction function, object[] args, Type[] returnTypes, object[] inArgs, int[] outArgs) public static object callFunction (LuaFunction function, object[] args, Type[] returnTypes, object[] inArgs, int[] outArgs)
{ {
// args is the return array of arguments, inArgs is the actual array // args is the return array of arguments, inArgs is the actual array
// of arguments passed to the function (with in parameters only), outArgs // of arguments passed to the function (with in parameters only), outArgs
// has the positions of out parameters // has the positions of out parameters
object returnValue; object returnValue;
int iRefArgs; int iRefArgs;
object[] returnValues = function.call(inArgs, returnTypes); object[] returnValues = function.call (inArgs, returnTypes);
if(returnTypes[0] == typeof(void)) if (returnTypes [0] == typeof(void)) {
{
returnValue = null; returnValue = null;
iRefArgs = 0; iRefArgs = 0;
} } else {
else returnValue = returnValues [0];
{
returnValue = returnValues[0];
iRefArgs = 1; iRefArgs = 1;
} }
for(int i = 0; i < outArgs.Length; i++) for (int i = 0; i < outArgs.Length; i++) {
{ args [outArgs [i]] = returnValues [iRefArgs];
args[outArgs[i]] = returnValues[iRefArgs];
iRefArgs++; iRefArgs++;
} }
......
...@@ -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.Method namespace LuaInterface.Method
...@@ -40,37 +39,33 @@ namespace LuaInterface.Method ...@@ -40,37 +39,33 @@ namespace LuaInterface.Method
public LuaFunction function; public LuaFunction function;
public Type[] returnTypes; public Type[] returnTypes;
public LuaDelegate() public LuaDelegate ()
{ {
function = null; function = null;
returnTypes = null; returnTypes = null;
} }
public object callFunction(object[] args, object[] inArgs, int[] outArgs) public object callFunction (object[] args, object[] inArgs, int[] outArgs)
{ {
// args is the return array of arguments, inArgs is the actual array // args is the return array of arguments, inArgs is the actual array
// of arguments passed to the function (with in parameters only), outArgs // of arguments passed to the function (with in parameters only), outArgs
// has the positions of out parameters // has the positions of out parameters
object returnValue; object returnValue;
int iRefArgs; int iRefArgs;
object[] returnValues = function.call(inArgs, returnTypes); object[] returnValues = function.call (inArgs, returnTypes);
if(returnTypes[0] == typeof(void)) if (returnTypes [0] == typeof(void)) {
{
returnValue = null; returnValue = null;
iRefArgs = 0; iRefArgs = 0;
} } else {
else returnValue = returnValues [0];
{
returnValue = returnValues[0];
iRefArgs = 1; iRefArgs = 1;
} }
// Sets the value of out and ref parameters (from // Sets the value of out and ref parameters (from
// the values returned by the Lua function). // the values returned by the Lua function).
for(int i = 0; i < outArgs.Length; i++) for (int i = 0; i < outArgs.Length; i++) {
{ args [outArgs [i]] = returnValues [iRefArgs];
args[outArgs[i]] = returnValues[iRefArgs];
iRefArgs++; iRefArgs++;
} }
......
...@@ -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.Method namespace LuaInterface.Method
...@@ -41,9 +40,9 @@ namespace LuaInterface.Method ...@@ -41,9 +40,9 @@ namespace LuaInterface.Method
// CP: Fix provided by Ben Bryant for delegates with one param // CP: Fix provided by Ben Bryant for delegates with one param
// link: http://luaforge.net/forum/message.php?msg_id=9318 // link: http://luaforge.net/forum/message.php?msg_id=9318
public void handleEvent(object[] args) public void handleEvent (object[] args)
{ {
handler.Call(args); handler.Call (args);
} }
//public void handleEvent(object sender,object data) //public void handleEvent(object sender,object data)
//{ //{
......
...@@ -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.Reflection; using System.Reflection;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -36,7 +35,7 @@ namespace LuaInterface.Method ...@@ -36,7 +35,7 @@ namespace LuaInterface.Method
/* /*
* Argument extraction with type-conversion function * Argument extraction with type-conversion function
*/ */
delegate object ExtractValue(LuaCore.lua_State luaState, int stackPos); delegate object ExtractValue (LuaCore.lua_State luaState, int stackPos);
/* /*
* Wrapper class for methods/constructors accessed from Lua. * Wrapper class for methods/constructors accessed from Lua.
...@@ -48,10 +47,9 @@ namespace LuaInterface.Method ...@@ -48,10 +47,9 @@ namespace LuaInterface.Method
{ {
private ObjectTranslator _Translator; private ObjectTranslator _Translator;
private MethodBase _Method; private MethodBase _Method;
private MethodCache _LastCalledMethod = new MethodCache(); private MethodCache _LastCalledMethod = new MethodCache ();
private string _MethodName; private string _MethodName;
private MemberInfo[] _Members; private MemberInfo[] _Members;
private IReflect _TargetType;
private ExtractValue _ExtractTarget; private ExtractValue _ExtractTarget;
private object _Target; private object _Target;
private BindingFlags _BindingType; private BindingFlags _BindingType;
...@@ -59,19 +57,18 @@ namespace LuaInterface.Method ...@@ -59,19 +57,18 @@ namespace LuaInterface.Method
/* /*
* Constructs the wrapper for a known MethodBase instance * Constructs the wrapper for a known MethodBase instance
*/ */
public LuaMethodWrapper(ObjectTranslator translator, object target, IReflect targetType, MethodBase method) public LuaMethodWrapper (ObjectTranslator translator, object target, IReflect targetType, MethodBase method)
{ {
_Translator = translator; _Translator = translator;
_Target = target; _Target = target;
_TargetType = targetType;
if(!targetType.IsNull()) if (!targetType.IsNull ())
_ExtractTarget = translator.typeChecker.getExtractor(targetType); _ExtractTarget = translator.typeChecker.getExtractor (targetType);
_Method = method; _Method = method;
_MethodName = method.Name; _MethodName = method.Name;
if(method.IsStatic) if (method.IsStatic)
_BindingType = BindingFlags.Static; _BindingType = BindingFlags.Static;
else else
_BindingType = BindingFlags.Instance; _BindingType = BindingFlags.Instance;
...@@ -80,18 +77,17 @@ namespace LuaInterface.Method ...@@ -80,18 +77,17 @@ namespace LuaInterface.Method
/* /*
* Constructs the wrapper for a known method name * Constructs the wrapper for a known method name
*/ */
public LuaMethodWrapper(ObjectTranslator translator, IReflect targetType, string methodName, BindingFlags bindingType) public LuaMethodWrapper (ObjectTranslator translator, IReflect targetType, string methodName, BindingFlags bindingType)
{ {
_Translator = translator; _Translator = translator;
_MethodName = methodName; _MethodName = methodName;
_TargetType = targetType;
if(!targetType.IsNull()) if (!targetType.IsNull ())
_ExtractTarget = translator.typeChecker.getExtractor(targetType); _ExtractTarget = translator.typeChecker.getExtractor (targetType);
_BindingType = bindingType; _BindingType = bindingType;
//CP: Removed NonPublic binding search and added IgnoreCase //CP: Removed NonPublic binding search and added IgnoreCase
_Members = targetType.UnderlyingSystemType.GetMember(methodName, MemberTypes.Method, bindingType | BindingFlags.Public | BindingFlags.IgnoreCase/*|BindingFlags.NonPublic*/); _Members = targetType.UnderlyingSystemType.GetMember (methodName, MemberTypes.Method, bindingType | BindingFlags.Public | BindingFlags.IgnoreCase/*|BindingFlags.NonPublic*/);
} }
/// <summary> /// <summary>
...@@ -99,226 +95,187 @@ namespace LuaInterface.Method ...@@ -99,226 +95,187 @@ namespace LuaInterface.Method
/// </summary> /// </summary>
/// <returns>num of things on stack</returns> /// <returns>num of things on stack</returns>
/// <param name="e">null for no pending exception</param> /// <param name="e">null for no pending exception</param>
int SetPendingException(Exception e) int SetPendingException (Exception e)
{ {
return _Translator.interpreter.SetPendingException(e); return _Translator.interpreter.SetPendingException (e);
} }
/* /*
* Calls the method. Receives the arguments from the Lua stack * Calls the method. Receives the arguments from the Lua stack
* and returns values in it. * and returns values in it.
*/ */
public int call(LuaCore.lua_State luaState) public int call (LuaCore.lua_State luaState)
{ {
var methodToCall = _Method; var methodToCall = _Method;
object targetObject = _Target; object targetObject = _Target;
bool failedCall = true; bool failedCall = true;
int nReturnValues = 0; int nReturnValues = 0;
if(!LuaLib.lua_checkstack(luaState, 5)) if (!LuaLib.lua_checkstack (luaState, 5))
throw new LuaException("Lua stack overflow"); throw new LuaException ("Lua stack overflow");
bool isStatic = (_BindingType & BindingFlags.Static) == BindingFlags.Static; bool isStatic = (_BindingType & BindingFlags.Static) == BindingFlags.Static;
SetPendingException(null); SetPendingException (null);
if(methodToCall.IsNull()) // Method from name if (methodToCall.IsNull ()) { // Method from name
{ if (isStatic)
if(isStatic)
targetObject = null; targetObject = null;
else else
targetObject = _ExtractTarget(luaState, 1); targetObject = _ExtractTarget (luaState, 1);
//LuaLib.lua_remove(luaState,1); // Pops the receiver //LuaLib.lua_remove(luaState,1); // Pops the receiver
if(!_LastCalledMethod.cachedMethod.IsNull()) // Cached? if (!_LastCalledMethod.cachedMethod.IsNull ()) { // Cached?
{
int numStackToSkip = isStatic ? 0 : 1; // If this is an instance invoe we will have an extra arg on the stack for the targetObject int numStackToSkip = isStatic ? 0 : 1; // If this is an instance invoe we will have an extra arg on the stack for the targetObject
int numArgsPassed = LuaLib.lua_gettop(luaState) - numStackToSkip; int numArgsPassed = LuaLib.lua_gettop (luaState) - numStackToSkip;
if(numArgsPassed == _LastCalledMethod.argTypes.Length) // No. of args match? if (numArgsPassed == _LastCalledMethod.argTypes.Length) { // No. of args match?
{ if (!LuaLib.lua_checkstack (luaState, _LastCalledMethod.outList.Length + 6))
if(!LuaLib.lua_checkstack(luaState, _LastCalledMethod.outList.Length + 6)) throw new LuaException ("Lua stack overflow");
throw new LuaException("Lua stack overflow");
try try {
{ for (int i = 0; i < _LastCalledMethod.argTypes.Length; i++) {
for(int i = 0; i < _LastCalledMethod.argTypes.Length; i++) if (_LastCalledMethod.argTypes [i].isParamsArray) {
{ object luaParamValue = _LastCalledMethod.argTypes [i].extractValue (luaState, i + 1 + numStackToSkip);
if(_LastCalledMethod.argTypes[i].isParamsArray) var paramArrayType = _LastCalledMethod.argTypes [i].paramsArrayType;
{
object luaParamValue = _LastCalledMethod.argTypes[i].extractValue(luaState, i + 1 + numStackToSkip);
var paramArrayType = _LastCalledMethod.argTypes[i].paramsArrayType;
Array paramArray; Array paramArray;
if(luaParamValue is LuaTable) if (luaParamValue is LuaTable) {
{
var table = (LuaTable)luaParamValue; var table = (LuaTable)luaParamValue;
paramArray = Array.CreateInstance(paramArrayType, table.Values.Count); paramArray = Array.CreateInstance (paramArrayType, table.Values.Count);
for(int x = 1; x <= table.Values.Count; x++) for (int x = 1; x <= table.Values.Count; x++)
paramArray.SetValue(Convert.ChangeType(table[x], paramArrayType), x - 1); paramArray.SetValue (Convert.ChangeType (table [x], paramArrayType), x - 1);
} } else {
else paramArray = Array.CreateInstance (paramArrayType, 1);
{ paramArray.SetValue (luaParamValue, 0);
paramArray = Array.CreateInstance(paramArrayType, 1);
paramArray.SetValue(luaParamValue, 0);
} }
_LastCalledMethod.args[_LastCalledMethod.argTypes[i].index] = paramArray; _LastCalledMethod.args [_LastCalledMethod.argTypes [i].index] = paramArray;
} } else {
else _LastCalledMethod.args [_LastCalledMethod.argTypes [i].index] =
{ _LastCalledMethod.argTypes [i].extractValue (luaState, i + 1 + numStackToSkip);
_LastCalledMethod.args[_LastCalledMethod.argTypes[i].index] =
_LastCalledMethod.argTypes[i].extractValue(luaState, i + 1 + numStackToSkip);
} }
if(_LastCalledMethod.args[_LastCalledMethod.argTypes[i].index] == null && if (_LastCalledMethod.args [_LastCalledMethod.argTypes [i].index] == null &&
!LuaLib.lua_isnil(luaState, i + 1 + numStackToSkip)) !LuaLib.lua_isnil (luaState, i + 1 + numStackToSkip))
throw new LuaException("argument number " + (i + 1) + " is invalid"); throw new LuaException ("argument number " + (i + 1) + " is invalid");
} }
if((_BindingType & BindingFlags.Static) == BindingFlags.Static) if ((_BindingType & BindingFlags.Static) == BindingFlags.Static)
_Translator.push(luaState, _LastCalledMethod.cachedMethod.Invoke(null, _LastCalledMethod.args)); _Translator.push (luaState, _LastCalledMethod.cachedMethod.Invoke (null, _LastCalledMethod.args));
else else {
{ if (_LastCalledMethod.cachedMethod.IsConstructor)
if(_LastCalledMethod.cachedMethod.IsConstructor) _Translator.push (luaState, ((ConstructorInfo)_LastCalledMethod.cachedMethod).Invoke (_LastCalledMethod.args));
_Translator.push(luaState, ((ConstructorInfo)_LastCalledMethod.cachedMethod).Invoke(_LastCalledMethod.args));
else else
_Translator.push(luaState, _LastCalledMethod.cachedMethod.Invoke(targetObject, _LastCalledMethod.args)); _Translator.push (luaState, _LastCalledMethod.cachedMethod.Invoke (targetObject, _LastCalledMethod.args));
} }
failedCall = false; failedCall = false;
} } catch (TargetInvocationException e) {
catch(TargetInvocationException e)
{
// Failure of method invocation // Failure of method invocation
return SetPendingException(e.GetBaseException()); return SetPendingException (e.GetBaseException ());
} } catch (Exception e) {
catch(Exception e) if (_Members.Length == 1) // Is the method overloaded?
{
if(_Members.Length == 1) // Is the method overloaded?
// No, throw error // No, throw error
return SetPendingException(e); return SetPendingException (e);
} }
} }
} }
// Cache miss // Cache miss
if(failedCall) if (failedCall) {
{
// System.Diagnostics.Debug.WriteLine("cache miss on " + methodName); // System.Diagnostics.Debug.WriteLine("cache miss on " + methodName);
// If we are running an instance variable, we can now pop the targetObject from the stack // If we are running an instance variable, we can now pop the targetObject from the stack
if(!isStatic) if (!isStatic) {
{ if (targetObject.IsNull ()) {
if(targetObject.IsNull()) _Translator.throwError (luaState, String.Format ("instance method '{0}' requires a non null target object", _MethodName));
{ LuaLib.lua_pushnil (luaState);
_Translator.throwError(luaState, String.Format("instance method '{0}' requires a non null target object", _MethodName));
LuaLib.lua_pushnil(luaState);
return 1; return 1;
} }
LuaLib.lua_remove(luaState, 1); // Pops the receiver LuaLib.lua_remove (luaState, 1); // Pops the receiver
} }
bool hasMatch = false; bool hasMatch = false;
string candidateName = null; string candidateName = null;
foreach(var member in _Members) foreach (var member in _Members) {
{
candidateName = member.ReflectedType.Name + "." + member.Name; candidateName = member.ReflectedType.Name + "." + member.Name;
var m = (MethodInfo)member; var m = (MethodInfo)member;
bool isMethod = _Translator.matchParameters(luaState, m, ref _LastCalledMethod); bool isMethod = _Translator.matchParameters (luaState, m, ref _LastCalledMethod);
if(isMethod) if (isMethod) {
{
hasMatch = true; hasMatch = true;
break; break;
} }
} }
if(!hasMatch) if (!hasMatch) {
{
string msg = (candidateName == null) ? "invalid arguments to method call" : ("invalid arguments to method: " + candidateName); string msg = (candidateName == null) ? "invalid arguments to method call" : ("invalid arguments to method: " + candidateName);
_Translator.throwError(luaState, msg); _Translator.throwError (luaState, msg);
LuaLib.lua_pushnil(luaState); LuaLib.lua_pushnil (luaState);
return 1; return 1;
} }
} }
} } else { // Method from MethodBase instance
else // Method from MethodBase instance if (methodToCall.ContainsGenericParameters) {
{ /*bool isMethod = */
if(methodToCall.ContainsGenericParameters) _Translator.matchParameters (luaState, methodToCall, ref _LastCalledMethod);
{
/*bool isMethod = */_Translator.matchParameters(luaState, methodToCall, ref _LastCalledMethod);
if(methodToCall.IsGenericMethodDefinition) if (methodToCall.IsGenericMethodDefinition) {
{
//need to make a concrete type of the generic method definition //need to make a concrete type of the generic method definition
var typeArgs = new List<Type>(); var typeArgs = new List<Type> ();
foreach(object arg in _LastCalledMethod.args) foreach (object arg in _LastCalledMethod.args)
typeArgs.Add(arg.GetType()); typeArgs.Add (arg.GetType ());
var concreteMethod = (methodToCall as MethodInfo).MakeGenericMethod(typeArgs.ToArray()); var concreteMethod = (methodToCall as MethodInfo).MakeGenericMethod (typeArgs.ToArray ());
_Translator.push(luaState, concreteMethod.Invoke(targetObject, _LastCalledMethod.args)); _Translator.push (luaState, concreteMethod.Invoke (targetObject, _LastCalledMethod.args));
failedCall = false; failedCall = false;
} } else if (methodToCall.ContainsGenericParameters) {
else if(methodToCall.ContainsGenericParameters) _Translator.throwError (luaState, "unable to invoke method on generic class as the current method is an open generic method");
{ LuaLib.lua_pushnil (luaState);
_Translator.throwError(luaState, "unable to invoke method on generic class as the current method is an open generic method");
LuaLib.lua_pushnil(luaState);
return 1; return 1;
} }
} } else {
else if (!methodToCall.IsStatic && !methodToCall.IsConstructor && targetObject == null) {
{ targetObject = _ExtractTarget (luaState, 1);
if(!methodToCall.IsStatic && !methodToCall.IsConstructor && targetObject == null) LuaLib.lua_remove (luaState, 1); // Pops the receiver
{
targetObject = _ExtractTarget(luaState, 1);
LuaLib.lua_remove(luaState, 1); // Pops the receiver
} }
if(!_Translator.matchParameters(luaState, methodToCall, ref _LastCalledMethod)) if (!_Translator.matchParameters (luaState, methodToCall, ref _LastCalledMethod)) {
{ _Translator.throwError (luaState, "invalid arguments to method call");
_Translator.throwError(luaState, "invalid arguments to method call"); LuaLib.lua_pushnil (luaState);
LuaLib.lua_pushnil(luaState);
return 1; return 1;
} }
} }
} }
if(failedCall) if (failedCall) {
{ if (!LuaLib.lua_checkstack (luaState, _LastCalledMethod.outList.Length + 6))
if(!LuaLib.lua_checkstack(luaState, _LastCalledMethod.outList.Length + 6)) throw new LuaException ("Lua stack overflow");
throw new LuaException("Lua stack overflow");
try try {
{ if (isStatic)
if(isStatic) _Translator.push (luaState, _LastCalledMethod.cachedMethod.Invoke (null, _LastCalledMethod.args));
_Translator.push(luaState, _LastCalledMethod.cachedMethod.Invoke(null, _LastCalledMethod.args)); else {
else if (_LastCalledMethod.cachedMethod.IsConstructor)
{ _Translator.push (luaState, ((ConstructorInfo)_LastCalledMethod.cachedMethod).Invoke (_LastCalledMethod.args));
if(_LastCalledMethod.cachedMethod.IsConstructor)
_Translator.push(luaState, ((ConstructorInfo)_LastCalledMethod.cachedMethod).Invoke(_LastCalledMethod.args));
else else
_Translator.push(luaState, _LastCalledMethod.cachedMethod.Invoke(targetObject, _LastCalledMethod.args)); _Translator.push (luaState, _LastCalledMethod.cachedMethod.Invoke (targetObject, _LastCalledMethod.args));
} }
} } catch (TargetInvocationException e) {
catch(TargetInvocationException e) return SetPendingException (e.GetBaseException ());
{ } catch (Exception e) {
return SetPendingException(e.GetBaseException()); return SetPendingException (e);
}
catch(Exception e)
{
return SetPendingException(e);
} }
} }
// Pushes out and ref return values // Pushes out and ref return values
for(int index = 0; index < _LastCalledMethod.outList.Length; index++) for (int index = 0; index < _LastCalledMethod.outList.Length; index++) {
{
nReturnValues++; nReturnValues++;
//for(int i=0;i<lastCalledMethod.outList.Length;i++) //for(int i=0;i<lastCalledMethod.outList.Length;i++)
_Translator.push(luaState, _LastCalledMethod.args[_LastCalledMethod.outList[index]]); _Translator.push (luaState, _LastCalledMethod.args [_LastCalledMethod.outList [index]]);
} }
//by isSingle 2010-09-10 11:26:31 //by isSingle 2010-09-10 11:26:31
...@@ -326,7 +283,7 @@ namespace LuaInterface.Method ...@@ -326,7 +283,7 @@ namespace LuaInterface.Method
// if not return void,we need add 1, // if not return void,we need add 1,
// or we will lost the function's return value // or we will lost the function's return value
// when call dotnet function like "int foo(arg1,out arg2,out arg3)" in lua code // when call dotnet function like "int foo(arg1,out arg2,out arg3)" in lua code
if(!_LastCalledMethod.IsReturnVoid && nReturnValues > 0) if (!_LastCalledMethod.IsReturnVoid && nReturnValues > 0)
nReturnValues++; nReturnValues++;
return nReturnValues < 1 ? 1 : nReturnValues; return nReturnValues < 1 ? 1 : nReturnValues;
......
...@@ -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.Method namespace LuaInterface.Method
......
...@@ -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.Reflection; using System.Reflection;
using LuaInterface.Extensions; using LuaInterface.Extensions;
...@@ -36,19 +35,16 @@ namespace LuaInterface.Method ...@@ -36,19 +35,16 @@ namespace LuaInterface.Method
{ {
private MethodBase _cachedMethod; private MethodBase _cachedMethod;
public MethodBase cachedMethod public MethodBase cachedMethod {
{ get {
get
{
return _cachedMethod; return _cachedMethod;
} }
set set {
{
_cachedMethod = value; _cachedMethod = value;
var mi = value as MethodInfo; var mi = value as MethodInfo;
if(!mi.IsNull()) if (!mi.IsNull ())
IsReturnVoid = string.Compare(mi.ReturnType.Name, "System.Void", true) == 0; IsReturnVoid = string.Compare (mi.ReturnType.Name, "System.Void", true) == 0;
} }
} }
......
...@@ -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.Reflection; using System.Reflection;
...@@ -41,7 +40,7 @@ namespace LuaInterface.Method ...@@ -41,7 +40,7 @@ namespace LuaInterface.Method
private EventInfo eventInfo; private EventInfo eventInfo;
private object target; private object target;
public RegisterEventHandler(EventHandlerContainer pendingEvents, object target, EventInfo eventInfo) public RegisterEventHandler (EventHandlerContainer pendingEvents, object target, EventInfo eventInfo)
{ {
this.target = target; this.target = target;
this.eventInfo = eventInfo; this.eventInfo = eventInfo;
...@@ -51,13 +50,13 @@ namespace LuaInterface.Method ...@@ -51,13 +50,13 @@ namespace LuaInterface.Method
/* /*
* Adds a new event handler * Adds a new event handler
*/ */
public Delegate Add(LuaFunction function) public Delegate Add (LuaFunction function)
{ {
//CP: Fix by Ben Bryant for event handling with one parameter //CP: Fix by Ben Bryant for event handling with one parameter
//link: http://luaforge.net/forum/message.php?msg_id=9266 //link: http://luaforge.net/forum/message.php?msg_id=9266
Delegate handlerDelegate = CodeGeneration.Instance.GetDelegate(eventInfo.EventHandlerType, function); Delegate handlerDelegate = CodeGeneration.Instance.GetDelegate (eventInfo.EventHandlerType, function);
eventInfo.AddEventHandler(target, handlerDelegate); eventInfo.AddEventHandler (target, handlerDelegate);
pendingEvents.Add(handlerDelegate, this); pendingEvents.Add (handlerDelegate, this);
return handlerDelegate; return handlerDelegate;
//MethodInfo mi = eventInfo.EventHandlerType.GetMethod("Invoke"); //MethodInfo mi = eventInfo.EventHandlerType.GetMethod("Invoke");
...@@ -72,18 +71,18 @@ namespace LuaInterface.Method ...@@ -72,18 +71,18 @@ namespace LuaInterface.Method
/* /*
* Removes an existing event handler * Removes an existing event handler
*/ */
public void Remove(Delegate handlerDelegate) public void Remove (Delegate handlerDelegate)
{ {
RemovePending(handlerDelegate); RemovePending (handlerDelegate);
pendingEvents.Remove(handlerDelegate); pendingEvents.Remove (handlerDelegate);
} }
/* /*
* Removes an existing event handler (without updating the pending handlers list) * Removes an existing event handler (without updating the pending handlers list)
*/ */
internal void RemovePending(Delegate handlerDelegate) internal void RemovePending (Delegate handlerDelegate)
{ {
eventInfo.RemoveEventHandler(target, handlerDelegate); eventInfo.RemoveEventHandler (target, handlerDelegate);
} }
} }
} }
\ No newline at end of file
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.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
......
...@@ -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.Globalization; using System.Globalization;
using System.Reflection; using System.Reflection;
...@@ -38,7 +37,7 @@ namespace LuaInterface ...@@ -38,7 +37,7 @@ namespace LuaInterface
{ {
private Type proxy; private Type proxy;
public ProxyType(Type proxy) public ProxyType (Type proxy)
{ {
this.proxy = proxy; this.proxy = proxy;
} }
...@@ -47,69 +46,68 @@ namespace LuaInterface ...@@ -47,69 +46,68 @@ namespace LuaInterface
/// Provide human readable short hand for this proxy object /// Provide human readable short hand for this proxy object
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public override string ToString() public override string ToString ()
{ {
return "ProxyType(" + UnderlyingSystemType + ")"; return "ProxyType(" + UnderlyingSystemType + ")";
} }
public Type UnderlyingSystemType public Type UnderlyingSystemType {
{
get { return proxy; } get { return proxy; }
} }
public FieldInfo GetField(string name, BindingFlags bindingAttr) public FieldInfo GetField (string name, BindingFlags bindingAttr)
{ {
return proxy.GetField(name, bindingAttr); return proxy.GetField (name, bindingAttr);
} }
public FieldInfo[] GetFields(BindingFlags bindingAttr) public FieldInfo[] GetFields (BindingFlags bindingAttr)
{ {
return proxy.GetFields(bindingAttr); return proxy.GetFields (bindingAttr);
} }
public MemberInfo[] GetMember(string name, BindingFlags bindingAttr) public MemberInfo[] GetMember (string name, BindingFlags bindingAttr)
{ {
return proxy.GetMember(name, bindingAttr); return proxy.GetMember (name, bindingAttr);
} }
public MemberInfo[] GetMembers(BindingFlags bindingAttr) public MemberInfo[] GetMembers (BindingFlags bindingAttr)
{ {
return proxy.GetMembers(bindingAttr); return proxy.GetMembers (bindingAttr);
} }
public MethodInfo GetMethod(string name, BindingFlags bindingAttr) public MethodInfo GetMethod (string name, BindingFlags bindingAttr)
{ {
return proxy.GetMethod(name, bindingAttr); return proxy.GetMethod (name, bindingAttr);
} }
public MethodInfo GetMethod(string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers) public MethodInfo GetMethod (string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers)
{ {
return proxy.GetMethod(name, bindingAttr, binder, types, modifiers); return proxy.GetMethod (name, bindingAttr, binder, types, modifiers);
} }
public MethodInfo[] GetMethods(BindingFlags bindingAttr) public MethodInfo[] GetMethods (BindingFlags bindingAttr)
{ {
return proxy.GetMethods(bindingAttr); return proxy.GetMethods (bindingAttr);
} }
public PropertyInfo GetProperty(string name, BindingFlags bindingAttr) public PropertyInfo GetProperty (string name, BindingFlags bindingAttr)
{ {
return proxy.GetProperty(name, bindingAttr); return proxy.GetProperty (name, bindingAttr);
} }
public PropertyInfo GetProperty(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) public PropertyInfo GetProperty (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
{ {
return proxy.GetProperty(name, bindingAttr, binder, returnType, types, modifiers); return proxy.GetProperty (name, bindingAttr, binder, returnType, types, modifiers);
} }
public PropertyInfo[] GetProperties(BindingFlags bindingAttr) public PropertyInfo[] GetProperties (BindingFlags bindingAttr)
{ {
return proxy.GetProperties(bindingAttr); return proxy.GetProperties (bindingAttr);
} }
public object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) public object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
{ {
return proxy.InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters); return proxy.InvokeMember (name, invokeAttr, binder, target, args, modifiers, culture, namedParameters);
} }
} }
} }
\ No newline at end of file
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