예제 #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);
     }
 }
예제 #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);
                }
            }
        }
예제 #3
0
        public static void Serialize(XmlDictionaryWriter writer, DirectoryAttributeModification attribute)
        {
            ChangeOperation             changeOperation = ChangeOperation.None;
            DirectoryAttributeOperation operation       = attribute.Operation;

            switch (operation)
            {
            case DirectoryAttributeOperation.Add:
            {
                changeOperation = ChangeOperation.Add;
                break;
            }

            case DirectoryAttributeOperation.Delete:
            {
                changeOperation = ChangeOperation.Delete;
                break;
            }

            case DirectoryAttributeOperation.Replace:
            {
                changeOperation = ChangeOperation.Replace;
                break;
            }
            }
            AttributeTypeAndValueSerializer.InternalSerialize(writer, changeOperation, AttributeNs.LookupNs(attribute.Name, SyntheticAttributeOperation.Write), attribute.Name, attribute);
        }
예제 #4
0
 public static void Serialize(XmlDictionaryWriter writer, ChangeOperation ChangeOperation, DirectoryAttributeModification attribute)
 {
     AttributeTypeAndValueSerializer.InternalSerialize(writer, ChangeOperation, AttributeNs.LookupNs(attribute.Name, SyntheticAttributeOperation.Write), attribute.Name, attribute);
 }