diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-23 22:17:49 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-23 22:17:49 +0200 |
| commit | 639be44b59e9f7320473374037a6fa850b4413b6 (patch) | |
| tree | 62c07ebed69efcc1adfbc571d81a709f7595efc8 /src/CompilerServices/CompilerServices.cs | |
| parent | 89f3b961d95eea59364719c26ed65f2df26d0b55 (diff) | |
First working scrollbar with heavy use of binding and events in xml
Diffstat (limited to 'src/CompilerServices/CompilerServices.cs')
| -rw-r--r-- | src/CompilerServices/CompilerServices.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs index a4f4110c..b2f2e14c 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/src/CompilerServices/CompilerServices.cs @@ -157,6 +157,7 @@ namespace go public static void ResolveBinding(DynAttribute binding, object _source) { object srcGO = _source; + string statement = binding.Value; Type srcType = _source.GetType (); Type dstType = binding.Source.GetType (); @@ -178,9 +179,9 @@ namespace go srcGO = (srcGO as GraphicObject).FindByName (bindTrg [0]); srcType = srcGO.GetType (); } - miSrc = srcType.GetMember (bindTrg.LastOrDefault()).FirstOrDefault (); - }else - miSrc = srcType.GetMember (binding.Value).FirstOrDefault (); + statement = bindTrg.LastOrDefault (); + } + miSrc = srcType.GetMember (statement).FirstOrDefault (); #region initialize target with actual value @@ -245,7 +246,7 @@ namespace go System.Reflection.Emit.Label labContinue = il.DefineLabel(); #region test if valueChange event is the correct one - il.Emit (OpCodes.Ldstr, binding.Value); + il.Emit (OpCodes.Ldstr, statement); //push name from arg il.Emit(OpCodes.Ldarg_1); FieldInfo fiMbName = typeof(ValueChangeEventArgs).GetField("MemberName"); @@ -257,11 +258,10 @@ namespace go il.MarkLabel(labContinue); #endregion - string[] srcLines = binding.Value.Trim().Split (new char[] { ';' }); - foreach (string srcLine in srcLines) { +// string[] srcLines = binding.Value.Trim().Split (new char[] { ';' }); +// foreach (string srcLine in srcLines) { //MethodInfo infoWriteLine = typeof(System.Diagnostics.Debug).GetMethod("WriteLine", new Type[] { typeof(string) }); - - string statement = srcLine.Trim (); + //load target ref onto the stack FieldInfo fiRefs = typeof(Interface).GetField("References"); @@ -300,7 +300,7 @@ namespace go // il.Emit(OpCodes.Callvirt, piTarget.GetSetMethod()); - } + //} il.MarkLabel(labFailed); il.Emit(OpCodes.Ret); |