Exemplo n.º 1
0
        /// <summary>
        /// Converts the source control to element.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="sc">The sc.</param>
        /// <returns></returns>
        /// <workitems>
        ///		<workitem rel="16385">Checked if the node is null before attempting to import it.</workitem>
        /// </workitems>
        private XmlElement ConvertSourceControlToElement(XmlDocument owner, SourceControl sc)
        {
            XmlElement ele  = sc.Serialize();
            XmlElement tNew = owner.CreateElement(sc.TypeName);
            //tNew.SetAttribute ( "ccnetconfigType", string.Format ( "{0}, {1}", sc.GetType ().FullName, sc.GetType ().Assembly.GetName ().Name ) );
            XmlElement tImport = (XmlElement)owner.ImportNode(ele, true);

            foreach (XmlElement tele in ele.SelectNodes("./*"))
            {
                XmlNode n = owner.ImportNode(tele, true);
                if (n != null)
                {
                    tNew.AppendChild(n);
                }
            }

            return(tNew);
        }