Ejemplo n.º 1
0
        public static void SerializeAttributeList(XmlDictionaryWriter writer, string xmlAttribute, string ns, string syntheticPrefix, string attrPrefix, IList <string> attributes)
        {
            string str;
            bool   flag = false;

            foreach (string attribute in attributes)
            {
                if (!AttributeNs.IsSynthetic(attribute, SyntheticAttributeOperation.Read, ref flag))
                {
                    string str1 = null;
                    string str2 = null;
                    if (!XmlUtility.SplitLdapAttributeOnOption(attribute, ref str1, ref str2))
                    {
                        writer.WriteElementString(xmlAttribute, ns, XmlUtility.AddPrefix(attrPrefix, attribute));
                    }
                    else
                    {
                        writer.WriteStartElement(xmlAttribute, ns);
                        XmlUtility.SerializeLdapAttributeOption(writer, str2);
                        writer.WriteValue(XmlUtility.AddPrefix(attrPrefix, str1));
                        writer.WriteEndElement();
                    }
                }
                else
                {
                    XmlDictionaryWriter xmlDictionaryWriter = writer;
                    string str3 = xmlAttribute;
                    string str4 = ns;
                    if (flag)
                    {
                        str = attribute;
                    }
                    else
                    {
                        str = XmlUtility.AddPrefix(syntheticPrefix, attribute);
                    }
                    xmlDictionaryWriter.WriteElementString(str3, str4, str);
                }
            }
        }
Ejemplo n.º 2
0
 private static string FormatAttributeName(string prefix, string attribute)
 {
     return(XmlUtility.AddPrefix(prefix, attribute));
 }