示例#1
0
        /// <summary>
        /// Used to duplicate all properties. Any property added must be duplicated here as well.
        /// </summary>
        /// <param name="newnode">The new node which is supposed to get a copy of the properties.</param>
        protected virtual void CloneProperties(Node newnode)
        {
            // clone attachements
            foreach (Attachments.Attachment attach in _attachments)
            {
                newnode.AddAttachment(attach.Clone(newnode));
            }

            // clone comment
            if (_comment != null)
            {
                newnode._comment = _comment.Clone();
            }
        }
示例#2
0
        /// <summary>
        /// Used to duplicate all properties. Any property added must be duplicated here as well.
        /// </summary>
        /// <param name="newnode">The new node which is supposed to get a copy of the properties.</param>
        protected virtual void CloneProperties(Node newnode)
        {
            // clone attachements
            foreach (Attachments.Attachment attach in _attachments)
            {
                newnode.AddAttachment(attach.Clone(newnode));
            }

            System.Type type = this.GetType();
            foreach (System.Reflection.FieldInfo fi in type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public))
            {
                if (fi.DeclaringType == type)
                {
                    fi.SetValue(newnode, fi.GetValue(this));
                }
            }
            // clone comment
            if (_comment != null)
            {
                newnode._comment = _comment.Clone();
            }
        }