public void AddLink(object sourceObject, string sourcePropertyName, Type[] indexer, object destinationObject, string destinationPropertyName) { Dictionary <string, Dictionary <DL_Indexer, Dictionary <object, Dictionary <string, DL_DataDestination> > > > v1 = null; object src = sourceObject; if (sourceObject is string && _objectManager != null) { src = _objectManager.FindElement(sourceObject.ToString()); } if (this.ContainsKey(src)) { v1 = this[src]; } if (v1 == null) { v1 = new Dictionary <string, Dictionary <DL_Indexer, Dictionary <object, Dictionary <string, DL_DataDestination> > > >(); this.Add(src, v1); IDataFlowSource source = sourceObject as IDataFlowSource; if (source != null) { source.OnPushProperty += new DelegateSinkPushValue(SinkPushValue); } else { if (_objectManager != null && sourceObject is string) { string path = sourceObject.ToString(); if (path.Length > 1) { delegateOnGetInstance eh = new delegateOnGetInstance(onAttachHabdler); _objectManager.WorkOnAllInstances(path, eh, new DelegateSinkPushValue(SinkPushValue)); } } } } Dictionary <DL_Indexer, Dictionary <object, Dictionary <string, DL_DataDestination> > > v2; if (v1.ContainsKey(sourcePropertyName)) { v2 = v1[sourcePropertyName]; } else { v2 = new Dictionary <DL_Indexer, Dictionary <object, Dictionary <string, DL_DataDestination> > >(); v1.Add(sourcePropertyName, v2); } Dictionary <object, Dictionary <string, DL_DataDestination> > v3 = null; Dictionary <DL_Indexer, Dictionary <object, Dictionary <string, DL_DataDestination> > > .Enumerator e2 = v2.GetEnumerator(); while (e2.MoveNext()) { if (e2.Current.Key.IsSameSignature(indexer)) { v3 = e2.Current.Value; break; } } if (v3 == null) { v3 = new Dictionary <object, Dictionary <string, DL_DataDestination> >(); v2.Add(new DL_Indexer(indexer), v3); } Dictionary <string, DL_DataDestination> v4; if (v3.ContainsKey(destinationObject)) { v4 = v3[destinationObject]; } else { v4 = new Dictionary <string, DL_DataDestination>(); v3.Add(destinationObject, v4); } if (!v4.ContainsKey(destinationPropertyName)) { v4.Add(destinationPropertyName, new DL_DataDestination()); } }
public void AddLink(object destinationObject, string destinationPropertyName, Type[] indexers, object sourceObject, string sourcePropertyName) { Dictionary <string, Dictionary <DL_Indexer, DL_DataSource> > v1 = null; object tgt = destinationObject; if (destinationObject is string && _objectManager != null) { tgt = _objectManager.FindElement(destinationObject.ToString()); } if (this.ContainsKey(tgt)) { v1 = this[tgt]; } if (v1 == null) { v1 = new Dictionary <string, Dictionary <DL_Indexer, DL_DataSource> >(); this.Add(tgt, v1); IDataFlowDestionation dest = destinationObject as IDataFlowDestionation; if (dest != null) { dest.OnPullProperty += new DelegateSinkPullValue(SinkPullValue); } else { if (_objectManager != null && destinationObject is string) { string path = destinationObject.ToString(); if (path.Length > 1) { delegateOnGetInstance eh = new delegateOnGetInstance(onAttachHabdler); _objectManager.WorkOnAllInstances(path, eh, new DelegateSinkPullValue(SinkPullValue)); } } } } Dictionary <DL_Indexer, DL_DataSource> v2; if (v1.ContainsKey(destinationPropertyName)) { v2 = v1[destinationPropertyName]; } else { v2 = new Dictionary <DL_Indexer, DL_DataSource>(); v1.Add(destinationPropertyName, v2); } DL_DataSource v3 = null; Dictionary <DL_Indexer, DL_DataSource> .Enumerator e2 = v2.GetEnumerator(); while (e2.MoveNext()) { if (e2.Current.Key.IsSameSignature(indexers)) { v3 = e2.Current.Value; break; } } if (v3 == null) { v3 = new DL_DataSource(); v2.Add(new DL_Indexer(indexers), v3); } v3.SourceObject = sourceObject; v3.PropertyName = sourcePropertyName; }