Exemple #1
0
        /// <summary>
        /// Recursive method to duplicate (deep copy) the current node and its children.
        /// </summary>
        /// <param name="fnParent">The FeedNode to which the new node will be parented under.</param>
        /// <returns>The new FeedNode which contains the same information as the current node (this).</returns>
        public FeedNode Duplicate(FeedNode fnParent)
        {
            FeedNode fnNew = new FeedNode(Title, XmlUrl, fnParent, IsFolder);

            fnNew.m_strText        = m_strText;
            fnNew.m_strHtmlUrl     = m_strHtmlUrl;
            fnNew.m_strDescription = m_strDescription;
            fnNew.m_strPath        = m_strPath;
            if (fnParent != null)
            {
                fnParent.AddChildNode(fnNew);
            }

            if (m_bFolder)
            {
                IDictionaryEnumerator enumNodes = m_listChildren.GetEnumerator();
                while (enumNodes.MoveNext())
                {
                    FeedNode feedNode = (FeedNode)enumNodes.Key;
                    if (feedNode != null)
                    {
                        feedNode.Duplicate(fnNew);
                    }
                }
            }
            return(fnNew);
        }
 public Job(FeedNode fn)
 {
     if (fn != null)
     {
         m_root = fn.Duplicate(null);
     }
 }