diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-10-12 13:53:37 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-10-12 13:53:37 +0200 |
| commit | ae08f9c696e2470e747d138ecf2b8c7d643e50a2 (patch) | |
| tree | 520290d8a31e950dba65e3c745bd0995d547dc68 /src/Interface.cs | |
| parent | e3fbc04e878808dd67a5c06fa22cff49d6e54e61 (diff) | |
Bindings clearance,
code clean
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 304e48b6..2ce0266b 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -454,53 +454,6 @@ namespace go return result; } - public static void resolveGOML (object hostClass) - { - foreach (DynAttribute es in GOMLResolver) { -// if (string.IsNullOrEmpty(es.Value)) -// continue; - - Type dstType = es.Source.GetType (); - MemberInfo miTarget = dstType.GetMember (es.MemberName).FirstOrDefault (); - - if (miTarget == null) { - Debug.WriteLine ("'{0}' Member not found in '{1}' type.", es.MemberName, dstType.ToString ()); - continue; - } - - if (miTarget.MemberType == MemberTypes.Event) { - if (es.Value.StartsWith ("{")) { - CompilerServices.CompileEventSource (es); - } else { - MethodInfo mi = hostClass.GetType ().GetMethod (es.Value, BindingFlags.NonPublic | BindingFlags.Public - | BindingFlags.Instance); - - object effectiveHostClass = hostClass; - if (mi == null) { - //TODO: hack to have it work, hostClass and dataSource should be clearly separated - mi = OpenTKGameWindow.currentWindow.GetType ().GetMethod (es.Value, BindingFlags.NonPublic | BindingFlags.Public - | BindingFlags.Instance); - if (mi == null) { - Debug.WriteLine ("Handler Method not found: " + es.Value); - continue; - } - effectiveHostClass = OpenTKGameWindow.currentWindow; - } - - EventInfo ei = es.Source.GetType ().GetEvent (es.MemberName); - MethodInfo addHandler = ei.GetAddMethod (); - Delegate del = Delegate.CreateDelegate (ei.EventHandlerType, effectiveHostClass, mi); - - - addHandler.Invoke (es.Source, new object[] { del }); - - } - } else { - CompilerServices.ResolveBinding (es, hostClass); - } - } - GOMLResolutionStack.Pop (); - } #endregion } |