コード例 #1
0
        // Token: 0x0600100A RID: 4106 RVA: 0x0005DCD0 File Offset: 0x0005BED0
        private void WriteADEntry(XmlWriter entryWriter, ADRawEntry entry)
        {
            base.Logger.TraceDebug(this, "Entering ADCrawler.WriteADEntry", new object[0]);
            object[]             properties           = entry.GetProperties(GrammarRecipientHelper.LookupProperties);
            RecipientTypeDetails recipientTypeDetails = (RecipientTypeDetails)properties[5];
            bool flag = this.ShouldAcceptADEntry(recipientTypeDetails);

            if (flag)
            {
                entryWriter.WriteStartElement("ADEntry");
                int i = 0;
                while (i < properties.Length)
                {
                    string text = string.Empty;
                    if (properties[i] == null)
                    {
                        base.Logger.TraceDebug(this, "ADEntry - Property='{0}', Value is null", new object[]
                        {
                            GrammarRecipientHelper.LookupProperties[i].Name
                        });
                        goto IL_22D;
                    }
                    if (GrammarRecipientHelper.LookupProperties[i] == ADRecipientSchema.UMRecipientDialPlanId)
                    {
                        ADObjectId adobjectId = properties[i] as ADObjectId;
                        text = adobjectId.ObjectGuid.ToString();
                        goto IL_22D;
                    }
                    if (GrammarRecipientHelper.LookupProperties[i] == ADRecipientSchema.AddressListMembership)
                    {
                        ADMultiValuedProperty <ADObjectId> admultiValuedProperty = properties[i] as ADMultiValuedProperty <ADObjectId>;
                        List <string> list = new List <string>(admultiValuedProperty.Count);
                        foreach (ADObjectId adobjectId2 in admultiValuedProperty)
                        {
                            list.Add(adobjectId2.ObjectGuid.ToString());
                        }
                        text = string.Join(",", list.ToArray());
                        goto IL_22D;
                    }
                    if (GrammarRecipientHelper.LookupProperties[i] == ADRecipientSchema.DisplayName || GrammarRecipientHelper.LookupProperties[i] == ADRecipientSchema.PhoneticDisplayName || GrammarRecipientHelper.LookupProperties[i] == ADObjectSchema.DistinguishedName)
                    {
                        text = GrammarRecipientHelper.GetSanitizedDisplayNameForXMLEntry(properties[i].ToString());
                        goto IL_22D;
                    }
                    if (GrammarRecipientHelper.LookupProperties[i] == ADRecipientSchema.PrimarySmtpAddress || GrammarRecipientHelper.LookupProperties[i] == ADObjectSchema.Guid || GrammarRecipientHelper.LookupProperties[i] == ADRecipientSchema.RecipientType || GrammarRecipientHelper.LookupProperties[i] == ADObjectSchema.WhenChangedUTC)
                    {
                        text = properties[i].ToString();
                        goto IL_22D;
                    }
                    if (GrammarRecipientHelper.LookupProperties[i] != ADRecipientSchema.RecipientTypeDetails)
                    {
                        ExAssert.RetailAssert(false, "Invalid lookup property '{0}'", new object[]
                        {
                            GrammarRecipientHelper.LookupProperties[i].Name
                        });
                        goto IL_22D;
                    }
                    base.Logger.TraceDebug(this, "Skipping property='{0}'", new object[]
                    {
                        GrammarRecipientHelper.LookupProperties[i].Name
                    });
IL_27E:
                    i++;
                    continue;
IL_22D:
                    base.Logger.TraceDebug(this, "ADEntry -  Property='{0}', Value='{1}'", new object[]
                    {
                        GrammarRecipientHelper.LookupProperties[i].Name,
                        text
                    });
                    entryWriter.WriteStartAttribute(GrammarRecipientHelper.LookupProperties[i].Name);
                    entryWriter.WriteString(text);
                    entryWriter.WriteEndAttribute();
                    goto IL_27E;
                }
                entryWriter.WriteEndElement();
            }
        }