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/IML/Context.cs | |
| parent | adbb4fd07a7c7ed236553d928be25c41c7106c27 (diff) | |
basic datasource binding functional without inititial set value during dschanged
Diffstat (limited to 'src/IML/Context.cs')
| -rw-r--r-- | src/IML/Context.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/IML/Context.cs b/src/IML/Context.cs index e5bad2d4..44a9018b 100644 --- a/src/IML/Context.cs +++ b/src/IML/Context.cs @@ -26,6 +26,11 @@ using System.Xml; namespace Crow.IML { + public class DataSourceBinding { + public bool TwoWay; + public MemberAddress Source; + public string DataSourceMember; + } /// <summary> /// Context while parsing IML /// </summary> @@ -42,23 +47,34 @@ namespace Crow.IML public Dictionary<string, string> Names = new Dictionary<string, string> (); public Dictionary<string, Dictionary<string, MemberAddress>> PropertyBindings = new Dictionary<string, Dictionary<string, MemberAddress>> (); + public Dictionary<NodeAddress, Dictionary<string, MemberAddress>> Bindings = + new Dictionary<NodeAddress, Dictionary<string, MemberAddress>>(); + public List<DataSourceBinding> DataSourceBindings = new List<DataSourceBinding>(); + public Context (Type rootType) { RootType = rootType; dm = new DynamicMethod ("dyn_instantiator", - MethodAttributes.Family | MethodAttributes.FamANDAssem | MethodAttributes.NewSlot, - CallingConventions.Standard, - typeof (void), new Type [] { typeof (object), typeof (Interface) }, RootType, true); + typeof (void), new Type [] { typeof (Instantiator), typeof (object), typeof (Interface) }, true); il = dm.GetILGenerator (256); initILGen (); } + + public NodeAddress CurrentNodeAddress { + get { + NodeAddress tmp = new NodeAddress(nodesStack.ToArray ()); + tmp.Add (CurrentNode); + return tmp; + } + } + void initILGen () { il.DeclareLocal (typeof (GraphicObject)); il.Emit (OpCodes.Nop); //set local GraphicObject to root object passed as 1st argument - il.Emit (OpCodes.Ldarg_0); + il.Emit (OpCodes.Ldarg_1); il.Emit (OpCodes.Stloc_0); CompilerServices.emitSetCurInterface (il); } |