Ejemplo n.º 1
0
        private void WalkNodesAndNotify(TreeNodeCollectionWrapper nodes, ChangeNotificationContext context)
        {
            if (nodes == null)
            {
                throw new ArgumentNullException("nodes");
            }

            // defer...
            this.WalkNodesAndNotify(nodes.InnerList, context);
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Called when an entity has been changed.
 /// </summary>
 /// <param name="context"></param>
 void IChangeRegisterCallback.EntityChanged(ChangeNotificationContext context)
 {
     this.EntityChanged(context);
 }