public void ResolveName(BindingDefinition bd) { if (!Names.ContainsKey(bd.TargetName)) { throw new Exception("Target Name '" + bd.TargetName + "' not found"); } NodeAddress resolvedNA = null; foreach (NodeAddress na in Names[bd.TargetName]) { bool naMatch = true; for (int i = 0; i < bd.TargetNA.Count; i++) { if (bd.TargetNA [i] != na [i]) { naMatch = false; break; } } if (naMatch) { resolvedNA = na; break; } } if (resolvedNA == null) { throw new Exception("Target Name '" + bd.TargetName + "' not found"); } bd.ResolveTargetName(resolvedNA); }
public BindingDefinition(NodeAddress _sourceNA, string _sourceMember, NodeAddress _targetNA, string _targetMember, string _targetName = "", bool _twoWay = false) { SourceNA = _sourceNA; SourceMember = _sourceMember; TargetNA = _targetNA; TargetMember = _targetMember; TargetName = _targetName; TwoWay = _twoWay; }
/// <summary> /// Emits cached delegate handler addition in the context of instantiator (ctx) /// </summary> public void emitCachedDelegateHandlerAddition(int index, EventInfo evt, NodeAddress address = null) { il.Emit(OpCodes.Ldloc_0); //load ref to current graphic object CompilerServices.emitGetInstance(il, address); il.Emit(OpCodes.Ldarg_0); //load ref to this instanciator onto the stack il.Emit(OpCodes.Ldfld, CompilerServices.fiCachedDel); il.Emit(OpCodes.Ldc_I4, index); //load delegate index il.Emit(OpCodes.Callvirt, CompilerServices.miGetDelegateListItem); il.Emit(OpCodes.Callvirt, evt.AddMethod); //call add event }
public override bool Equals(object obj) { if (obj == null) { return(false); } NodeAddress na = (NodeAddress)obj; return(this.SequenceEqual(na)); }
public MemberAddress(NodeAddress _address, MemberInfo _member) { Address = _address; member = _member; memberName = ""; if (member != null) { memberName = member.Name; } }
public void StorePropertyBinding(NodeAddress origNA, string origMember, NodeAddress destNA, string destMember) { Dictionary <string, List <MemberAddress> > nodeBindings = null; if (Bindings.ContainsKey(origNA)) { nodeBindings = Bindings [origNA]; } else { nodeBindings = new Dictionary <string, List <MemberAddress> > (); Bindings [origNA] = nodeBindings; } if (!nodeBindings.ContainsKey(origMember)) { nodeBindings [origMember] = new List <MemberAddress> (); } nodeBindings [origMember].Add(new MemberAddress(destNA, destMember)); }
// public string Name { // get { return memberName; } // set { memberName = value; } // } public MemberAddress(NodeAddress _address, string _member, bool findMember = true) { Address = _address; memberName = _member; member = null; if (Address == null) { return; } if (Address.Count == 0) { return; } if (!findMember) { return; } if (!tryFindMember()) { throw new Exception("Member Not Found: " + memberName); } }
public EventBinding(NodeAddress _sourceNA, EventInfo _sourceEvt, NodeAddress _targetNA, string _targetMember, string _targetName = "") : base(_sourceNA, _sourceEvt.Name, _targetNA, _targetMember, _targetName) { SourceEvent = _sourceEvt; }
/// <summary> /// replace the target node address with corresponding named node address, and clear the target name once resolved /// </summary> /// <param name="newTargetNA">Named Node</param> public void ResolveTargetName(NodeAddress newTargetNA) { TargetNA = newTargetNA; TargetName = ""; }
public BindingDefinition(NodeAddress _sourceNA, string _sourceMember) { SourceNA = _sourceNA; SourceMember = _sourceMember; }