using System;
namespace SerializableCallback
{
///
/// https://github.com/Siccity/SerializableCallback
///
///
public class InvokableCallback : InvokableCallbackBase
{
///
/// https://github.com/Siccity/SerializableCallback
///
public Func func;
///
/// https://github.com/Siccity/SerializableCallback
///
/// The return value of the callback
public TReturn Invoke()
{
return func();
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
/// The return value of the callback
public override TReturn Invoke(params object[] args)
{
return func();
}
///
/// Constructor
///
///
///
public InvokableCallback(object target, string methodName)
{
if (target == null || string.IsNullOrEmpty(methodName))
{
func = () => default(TReturn);
}
else
{
func = (System.Func)System.Delegate.CreateDelegate(typeof(System.Func), target, methodName);
}
}
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
///
public class InvokableCallback : InvokableCallbackBase
{
///
/// https://github.com/Siccity/SerializableCallback
///
public Func func;
///
/// https://github.com/Siccity/SerializableCallback
///
///
/// The return value of the callback
public TReturn Invoke(T0 arg0)
{
return func(arg0);
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
/// the return value of the callback
public override TReturn Invoke(params object[] args)
{
return func((T0)args[0]);
}
///
/// Constructor
///
///
///
public InvokableCallback(object target, string methodName)
{
if (target == null || string.IsNullOrEmpty(methodName))
{
func = x => default(TReturn);
}
else
{
func = (System.Func)System.Delegate.CreateDelegate(typeof(System.Func), target, methodName);
}
}
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
///
///
public class InvokableCallback : InvokableCallbackBase
{
///
/// https://github.com/Siccity/SerializableCallback
///
public Func func;
///
/// https://github.com/Siccity/SerializableCallback
///
///
///
/// The return of the callback
public TReturn Invoke(T0 arg0, T1 arg1)
{
return func(arg0, arg1);
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
/// The return value of the callback
public override TReturn Invoke(params object[] args)
{
return func((T0)args[0], (T1)args[1]);
}
///
/// Constructor
///
///
///
public InvokableCallback(object target, string methodName)
{
if (target == null || string.IsNullOrEmpty(methodName))
{
func = (x, y) => default(TReturn);
}
else
{
func = (System.Func)System.Delegate.CreateDelegate(typeof(System.Func), target, methodName);
}
}
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
///
///
///
public class InvokableCallback : InvokableCallbackBase
{
///
/// https://github.com/Siccity/SerializableCallback
///
public Func func;
///
/// https://github.com/Siccity/SerializableCallback
///
///
///
///
/// The return value of the callback
public TReturn Invoke(T0 arg0, T1 arg1, T2 arg2)
{
return func(arg0, arg1, arg2);
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
/// The return value of the callback
public override TReturn Invoke(params object[] args)
{
return func((T0)args[0], (T1)args[1], (T2)args[2]);
}
///
/// Constructor
///
///
///
public InvokableCallback(object target, string methodName)
{
if (target == null || string.IsNullOrEmpty(methodName))
{
func = (x, y, z) => default(TReturn);
}
else
{
func = (System.Func)System.Delegate.CreateDelegate(typeof(System.Func), target, methodName);
}
}
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
///
///
///
///
public class InvokableCallback : InvokableCallbackBase
{
///
/// https://github.com/Siccity/SerializableCallback
///
public Func func;
///
/// https://github.com/Siccity/SerializableCallback
///
///
///
///
///
/// The return value of the callback
public TReturn Invoke(T0 arg0, T1 arg1, T2 arg2, T3 arg3)
{
return func(arg0, arg1, arg2, arg3);
}
///
/// https://github.com/Siccity/SerializableCallback
///
///
/// The return value of the callback
public override TReturn Invoke(params object[] args)
{
return func((T0)args[0], (T1)args[1], (T2)args[2], (T3)args[3]);
}
///
/// Constructor
///
///
///
public InvokableCallback(object target, string methodName)
{
if (target == null || string.IsNullOrEmpty(methodName))
{
func = (x, y, z, w) => default(TReturn);
}
else
{
func = (System.Func)System.Delegate.CreateDelegate(typeof(System.Func), target, methodName);
}
}
}
}