コード例 #1
0
ファイル: ObjectTreeView.cs プロジェクト: radtek/BootFX
        private void WalkNodesAndNotify(TreeNodeCollectionWrapper nodes, ChangeNotificationContext context)
        {
            if (nodes == null)
            {
                throw new ArgumentNullException("nodes");
            }

            // defer...
            this.WalkNodesAndNotify(nodes.InnerList, context);
        }
コード例 #2
0
ファイル: ObjectTreeView.cs プロジェクト: radtek/BootFX
        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);
                }
            }
        }
コード例 #3
0
ファイル: ObjectTreeView.cs プロジェクト: radtek/BootFX
        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);
        }
コード例 #4
0
ファイル: ObjectTreeView.cs プロジェクト: radtek/BootFX
 /// <summary>
 /// Called when an entity has been changed.
 /// </summary>
 /// <param name="context"></param>
 void IChangeRegisterCallback.EntityChanged(ChangeNotificationContext context)
 {
     this.EntityChanged(context);
 }