aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-01-02 15:49:11 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2017-01-02 15:49:11 +0100
commitca2044c913d034889dc50e57d8b1acaa9bde2a35 (patch)
tree3c1b589aa682aece50502fc43d59324ee2f6fa09
parent26fc4b0e6268e58d7694ccf87e57de59d3b6b9a1 (diff)
search for private and public handler methods
-rw-r--r--src/CompilerServices/CompilerServices.cs6
-rw-r--r--src/Instantiator.cs8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs
index 42ae5f7b..e0d6c1e0 100644
--- a/src/CompilerServices/CompilerServices.cs
+++ b/src/CompilerServices/CompilerServices.cs
@@ -562,9 +562,11 @@ namespace Crow
}
internal static Delegate createDel(Type eventType, object instance, string method){
Type t = instance.GetType ();
- MethodInfo mi = t.GetMethod (method);
- if (mi == null)
+ MethodInfo mi = t.GetMethod (method, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
+ if (mi == null) {
+ Debug.WriteLine ("Handler Method '{0}' not found in '{1}'", method, t);
return null;
+ }
return Delegate.CreateDelegate (eventType, instance, mi);
}
public static Delegate compileDynEventHandler(EventInfo sourceEvent, string expression, NodeAddress currentNode = null){
diff --git a/src/Instantiator.cs b/src/Instantiator.cs
index 402df1cc..6aaa7483 100644
--- a/src/Instantiator.cs
+++ b/src/Instantiator.cs
@@ -358,6 +358,10 @@ namespace Crow
NodeAddress sourceNA = ctx.CurrentNodeAddress;
BindingDefinition bindingDef = splitBindingExp (sourceNA, sourceMember, expression);
+ #if DEBUG_BINDING
+ Debug.WriteLine("Property Binding: " + bindingDef.ToString());
+ #endif
+
if (bindingDef.IsDataSourceBinding)//bind on data source
emitDataSourceBindings (ctx, bindingDef);
else
@@ -427,6 +431,10 @@ namespace Crow
NodeAddress currentNode = ctx.CurrentNodeAddress;
BindingDefinition bindingDef = splitBindingExp (currentNode, sourceEvent.Name, expression);
+ #if DEBUG_BINDING
+ Debug.WriteLine("Event Binding: " + bindingDef.ToString());
+ #endif
+
if (bindingDef.IsTemplateBinding | bindingDef.IsDataSourceBinding) {
//we need to bind datasource method to source event
DynamicMethod dm = new DynamicMethod ("dyn_dschangedForHandler" + NewId,