Ejemplo n.º 1
0
        private static void SerializeParameterToXmlDocument(XmlDocument xmlDoc, XmlElement root, IMemberBuildParameters setupPara, string builderFullName)
        {
            var setupParaType     = setupPara.GetType(); // handler.ParameterDataType;
            var setupParaXml      = setupPara.Serialize();
            var setupParaTypeName = setupParaType.Name;

            var ele  = xmlDoc.CreateElement(builderFullName);
            var ele2 = xmlDoc.CreateElement(setupParaTypeName);

            root.AppendChild(ele);
            ele.AppendChild(ele2);
            var innerDoc = new XmlDocument();
            var xml      = setupParaXml;

            innerDoc.LoadXml(xml);
            ele2.InnerXml = innerDoc[setupParaTypeName].InnerXml;
            foreach (XmlAttribute item in innerDoc[setupParaTypeName].Attributes)
            {
                if (item.Name != "xmlns:xsi" && item.Name != "xmlns:xsd")
                {
                    var attr = xmlDoc.CreateAttribute(item.Name);
                    attr.Value = item.Value;
                    ele2.Attributes.Append(attr);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the xml data representation of a single registered <see cref="IMemberBuilder"/>s parameters.
 /// </summary>
 /// <param name="builderType">Type of the builder to request data for.</param>
 /// <param name="parameters">The parameters with the data to serialize.</param>
 /// <returns>
 /// The serialized data of the specified <paramref name="builderType"/>.
 /// </returns>
 public string SerializeParametersForBuilderType(Type builderType, IMemberBuildParameters parameters)
 {
     return(SerializeParametersForBuilderType(builderType, parameters.GetType().Name, parameters.Serialize()));
 }
Ejemplo n.º 3
0
        private static void SerializeParameterToXmlDocument(XmlDocument xmlDoc, XmlElement root, IMemberBuildParameters setupPara, string builderFullName)
        {
            var setupParaType = setupPara.GetType(); // handler.ParameterDataType;
            var setupParaXml = setupPara.Serialize();
            var setupParaTypeName = setupParaType.Name;

            var ele = xmlDoc.CreateElement(builderFullName);
            var ele2 = xmlDoc.CreateElement(setupParaTypeName);
            root.AppendChild(ele);
            ele.AppendChild(ele2);
            var innerDoc = new XmlDocument();
            var xml = setupParaXml;
            innerDoc.LoadXml(xml);
            ele2.InnerXml = innerDoc[setupParaTypeName].InnerXml;
            foreach (XmlAttribute item in innerDoc[setupParaTypeName].Attributes)
            {
                if (item.Name != "xmlns:xsi" && item.Name != "xmlns:xsd")
                {
                    var attr = xmlDoc.CreateAttribute(item.Name);
                    attr.Value = item.Value;
                    ele2.Attributes.Append(attr);
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the xml data representation of a single registered <see cref="IMemberBuilder"/>s parameters.
 /// </summary>
 /// <param name="builderType">Type of the builder to request data for.</param>
 /// <param name="parameters">The parameters with the data to serialize.</param>
 /// <returns>
 /// The serialized data of the specified <paramref name="builderType"/>.
 /// </returns>
 public string SerializeParametersForBuilderType(Type builderType, IMemberBuildParameters parameters)
 {
     return SerializeParametersForBuilderType(builderType, parameters.GetType().Name, parameters.Serialize());
 }