Esempio n. 1
0
        /// <summary>
        /// Creates the specified node.
        /// </summary>
        /// <param name="node">The node.</param>
        /// <returns></returns>
        static public CompositeBase CreateCopy(CompositeBase node)
        {
            CompositeBase result;

            if (node.IsLeaf)
            {
                result = new CompositeLeaf((CompositeLeaf)node);
            }
            else
            {
                result = new Composite((Composite)node);                         //BUGBUG N.B. Types are not preserved....
            }
            return(result);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompositeLeaf"/> class.
 /// </summary>
 /// <param name="source">The source.</param>
 public CompositeLeaf(CompositeLeaf source) : this(source.Name, source.Value, source._nodeType)
 {
 }