Example #1
0
        /// <summary>
        /// Sets the parent of the specified value.
        /// If a parent is already set, an ArgumentException will be thrown.
        /// </summary>
        protected void SetParent(DocumentObject val)
        {
            if (val != null)
            {
                if (val.Parent != null)
                {
                    throw new ArgumentException(DomSR.ParentAlreadySet(val, this));
                }

                val.parent = this;
            }
        }
        /// <summary>
        /// Sets the parent of the specified value.
        /// If a parent is already set, an ArgumentException will be thrown.
        /// </summary>
        protected void SetParent(DocumentObject value)
        {
            if (value != null)
            {
                if (value.Parent != null)
                {
                    throw new ArgumentException(DomSR.ParentAlreadySet(value, this));
                }

                value._parent   = this;
                value._document = null;
                value._section  = null;
            }
        }