Example #1
0
        public object Send(IObject context, object receiver)
        {
            if (receiver is IObject)
            {
                return(this.Send(context, (IObject)receiver));
            }

            if (globalMethods.ContainsKey(this.symbol))
            {
                INativeMethod method = globalMethods[this.symbol];
                return(method.Execute(context, receiver, this.arguments));
            }

            Type type = receiver.GetType();

            object[] parameters = null;

            if (this.arguments != null)
            {
                parameters = this.arguments.ToArray();
            }

            return(type.InvokeMember(this.symbol, System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Instance, null, receiver, parameters));
        }
Example #2
0
 public MethodRegistration(string name, string tracingName, INativeMethod method)
 {
     Name        = name;
     TracingName = tracingName;
     Method      = method;
 }