Beispiel #1
0
 public static bool IsSynthetic(string attribute, SyntheticAttributeOperation operation, ref bool hasPrefix)
 {
     hasPrefix = false;
     if (!AttributeNs.IsSynthetic(attribute, operation))
     {
         return(false);
     }
     else
     {
         if (string.Equals(attribute, "ad:all", StringComparison.Ordinal))
         {
             hasPrefix = true;
         }
         return(true);
     }
 }
Beispiel #2
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);
                }
            }
        }