diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-11-19 11:16:01 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-11-19 11:16:01 +0100 |
| commit | 4fb8b3a075bd8232be6fdcbb1f5a3b45265d33b4 (patch) | |
| tree | 766be5b33f22c7c9097c0ca5545fe8c24a58c78a /src/CompilerServices/CompilerServices.cs | |
| parent | adbb4fd07a7c7ed236553d928be25c41c7106c27 (diff) | |
basic datasource binding functional without inititial set value during dschanged
Diffstat (limited to 'src/CompilerServices/CompilerServices.cs')
| -rw-r--r-- | src/CompilerServices/CompilerServices.cs | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs index d8f113e2..18bc78ea 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/src/CompilerServices/CompilerServices.cs @@ -15,7 +15,7 @@ namespace Crow static MethodInfo miAddBinding = typeof(GraphicObject).GetMethod ("BindMember"); static FieldInfo miSetCurIface = typeof(GraphicObject).GetField ("currentInterface", BindingFlags.NonPublic | BindingFlags.Instance); - static MethodInfo stringEquals = typeof (string).GetMethod + internal static MethodInfo stringEquals = typeof (string).GetMethod ("Equals", new Type [3] { typeof (string), typeof (string), typeof (StringComparison) }); static MethodInfo miFindByName = typeof (GraphicObject).GetMethod ("FindByName"); @@ -38,21 +38,35 @@ namespace Crow #endregion #region ValueChange Reflexion member info - static EventInfo eiValueChange = typeof (IValueChange).GetEvent ("ValueChanged"); - static MethodInfo miInvokeValueChange = eiValueChange.EventHandlerType.GetMethod ("Invoke"); - static Type [] argsValueChange = { typeof (object), typeof (object), miInvokeValueChange.GetParameters () [1].ParameterType }; - static FieldInfo fiNewValue = typeof (ValueChangeEventArgs).GetField ("NewValue"); - static FieldInfo fiMbName = typeof (ValueChangeEventArgs).GetField ("MemberName"); - static MethodInfo miValueChangeAdd = eiValueChange.GetAddMethod (); + internal static EventInfo eiValueChange = typeof (IValueChange).GetEvent ("ValueChanged"); + internal static MethodInfo miInvokeValueChange = eiValueChange.EventHandlerType.GetMethod ("Invoke"); + internal static Type [] argsValueChange = { typeof (object), typeof (object), miInvokeValueChange.GetParameters () [1].ParameterType }; + internal static FieldInfo fiNewValue = typeof (ValueChangeEventArgs).GetField ("NewValue"); + internal static FieldInfo fiMbName = typeof (ValueChangeEventArgs).GetField ("MemberName"); + internal static MethodInfo miValueChangeAdd = eiValueChange.GetAddMethod (); + + internal static EventInfo eiDSChange = typeof (GraphicObject).GetEvent ("DataSourceChanged"); + internal static MethodInfo miInvokeDSChange = eiDSChange.EventHandlerType.GetMethod ("Invoke"); + internal static Type [] argsDSChange = {typeof (object), typeof (object), miInvokeDSChange.GetParameters () [1].ParameterType }; + internal static FieldInfo fiDSCNewDS = typeof (DataSourceChangeEventArgs).GetField ("NewDataSource"); + + internal static MethodInfo miCreateBoundDelegate = typeof(DynamicMethod). + GetMethod("CreateDelegate", new Type[] { typeof(Type), typeof(object)}); + internal static MethodInfo miObjToString = typeof(object).GetMethod("ToString"); + + + internal static Type ehTypeDSChange = eiDSChange.EventHandlerType; + internal static FieldInfo fi_ehTypeDSChange = typeof(CompilerServices).GetField("ehTypeDSChange", BindingFlags.Static | BindingFlags.NonPublic); + #endregion /// <summary> - /// Loc0 is the current graphic object and arg1 of loader is the current interface + /// Loc0 is the current graphic object and arg2 of loader is the current interface /// </summary> /// <param name="il">Il.</param> public static void emitSetCurInterface(ILGenerator il){ il.Emit (OpCodes.Ldloc_0); - il.Emit (OpCodes.Ldarg_1); + il.Emit (OpCodes.Ldarg_2); il.Emit (OpCodes.Stfld, miSetCurIface); } public static void emitBindingCreation(ILGenerator il, string memberName, string expression){ |