private void WalkNodesAndNotify(TreeNodeCollectionWrapper nodes, ChangeNotificationContext context) { if (nodes == null) { throw new ArgumentNullException("nodes"); } // defer... this.WalkNodesAndNotify(nodes.InnerList, context); }
private void WalkNodesAndNotify(TreeNodeCollection nodes, ChangeNotificationContext context) { if (nodes == null) { throw new ArgumentNullException("nodes"); } if (context == null) { throw new ArgumentNullException("context"); } // walk... foreach (TreeNode node in nodes) { bool doChildren = false; // get... ObjectTreeNode objectNode = node as ObjectTreeNode; if (objectNode != null) { // match? if (objectNode.InnerObjectEntityType != null && context.EntityType.IsOfType(context.EntityType)) { if (EntityIdentification.CompareEntityKeyValues(objectNode.InnerObject, context.Entity)) { // this one has changed... objectNode.EntityChanged(context.Entity, context.Unit); } } // children? if (objectNode.IsPopulated) { doChildren = true; } } else { doChildren = true; } // children... if (doChildren) { this.WalkNodesAndNotify(node.Nodes, context); } } }
private void EntityChanged(ChangeNotificationContext context) { if (context == null) { throw new ArgumentNullException("context"); } // flip... if (this.InvokeRequired) { EntityChangedDelegate d = new EntityChangedDelegate(this.EntityChanged); this.Invoke(d, new object[] { context }); return; } // notify... this.WalkNodesAndNotify(this.Nodes, context); }
/// <summary> /// Called when an entity has been changed. /// </summary> /// <param name="context"></param> void IChangeRegisterCallback.EntityChanged(ChangeNotificationContext context) { this.EntityChanged(context); }