Ejemplo n.º 1
0
        /// <summary>
        /// Correct children.
        /// </summary>
        public virtual bool CorrectChildren()
        {
            bool bRet = false;

            for (int i = this.Children.Count - 1; i >= 0; i--)
            {
                NodeShape shape = this.Children[i];
                if (!this.CanHostShape(shape.GetDomainClassId()))
                {
                    shape.Delete();
                    bRet = true;
                }
                else if (shape.CorrectChildren())
                {
                    bRet = true;
                }
            }

            foreach (Diagram d in this.IncludedDiagrams)
            {
                if (d.CorrectChildren())
                {
                    bRet = true;
                }
            }

            return(bRet);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Correct the children elements.
        /// </summary>
        public virtual bool CorrectChildren()
        {
            bool bRet = false;

            for (int i = this.Children.Count - 1; i >= 0; i--)
            {
                NodeShape shape = this.Children[i];
                if (!this.CanHostShape(shape.GetDomainClassId()))
                {
                    shape.Delete();
                    bRet = true;
                }
                else
                {
                    if (shape.IsRelativeChildShape && !this.RelativeChildren.Contains(shape))
                    {
                        if (this.NestedChildren.Contains(shape))
                        {
                            this.NestedChildren.Remove(shape);
                        }
                        this.RelativeChildren.Add(shape);
                    }
                    else if (!shape.IsRelativeChildShape && !this.NestedChildren.Contains(shape))
                    {
                        if (this.RelativeChildren.Contains(shape))
                        {
                            this.RelativeChildren.Remove(shape);
                        }
                        this.NestedChildren.Add(shape);
                    }

                    shape.CorrectChildren();
                }
            }
            return(bRet);
        }