Beispiel #1
0
        private static ParticipantEntryId.WabEntryFlag ReplaceObjectTypeInformation(ParticipantEntryId.WabEntryFlag input, ref LegacyRecipientDisplayType?legacyRecipientDisplayType, string legacyDN)
        {
            LegacyRecipientDisplayType valueOrDefault = legacyRecipientDisplayType.GetValueOrDefault();

            ParticipantEntryId.WabEntryFlag wabEntryFlag;
            if (legacyRecipientDisplayType != null)
            {
                switch (valueOrDefault)
                {
                case LegacyRecipientDisplayType.MailUser:
                case LegacyRecipientDisplayType.Forum:
                case LegacyRecipientDisplayType.RemoteMailUser:
                    goto IL_33;

                case LegacyRecipientDisplayType.DistributionList:
                case LegacyRecipientDisplayType.DynamicDistributionList:
                    wabEntryFlag = ParticipantEntryId.WabEntryFlag.DirectoryDL;
                    goto IL_61;
                }
                ExTraceGlobals.StorageTracer.TraceDebug <string, LegacyRecipientDisplayType?>(0L, "Cannot construct ADParticipantEntryId (legDN=\"{0}\") with DisplayType={1}. Defaulting to MailUser.", legacyDN, legacyRecipientDisplayType);
                legacyRecipientDisplayType = new LegacyRecipientDisplayType?(LegacyRecipientDisplayType.MailUser);
            }
IL_33:
            wabEntryFlag = ParticipantEntryId.WabEntryFlag.DirectoryPerson;
IL_61:
            return((input & (ParticipantEntryId.WabEntryFlag.HomeFax | ParticipantEntryId.WabEntryFlag.OtherFax | ParticipantEntryId.WabEntryFlag.EmailIndex1 | ParticipantEntryId.WabEntryFlag.Outlook)) | wabEntryFlag);
        }
Beispiel #2
0
 internal StoreParticipantEntryId(ParticipantEntryId.WabEntryFlag flags, ParticipantEntryId.Reader reader)
 {
     EnumValidator.AssertValid <ParticipantEntryId.WabEntryFlag>(flags);
     this.isMapiPDL         = StoreParticipantEntryId.WabEntryFlagToMapiPDL(flags);
     this.emailAddressIndex = StoreParticipantEntryId.WabEntryFlagToEmailAddressIndex(flags);
     this.ltEntryId         = reader.ReadLTEntryId();
     this.useWabFormat      = true;
     reader.EnsureEnd();
 }
Beispiel #3
0
        private static bool WabEntryFlagToMapiPDL(ParticipantEntryId.WabEntryFlag wabEntryFlag)
        {
            switch ((byte)(wabEntryFlag & ParticipantEntryId.WabEntryFlag.ObjectTypeMask))
            {
            case 3:
                return(false);

            case 4:
                return(true);

            default:
                throw new CorruptDataException(ServerStrings.ExInvalidParticipantEntryId);
            }
        }
Beispiel #4
0
 private static EmailAddressIndex WabEntryFlagToEmailAddressIndex(ParticipantEntryId.WabEntryFlag wabEntryFlag)
 {
     ParticipantEntryId.WabEntryFlag wabEntryFlag2 = wabEntryFlag & ParticipantEntryId.WabEntryFlag.EmailIndexMask;
     if (wabEntryFlag2 <= ParticipantEntryId.WabEntryFlag.OtherFax)
     {
         if (wabEntryFlag2 == ParticipantEntryId.WabEntryFlag.Envelope)
         {
             return(EmailAddressIndex.BusinessFax);
         }
         if (wabEntryFlag2 == ParticipantEntryId.WabEntryFlag.HomeFax)
         {
             return(EmailAddressIndex.HomeFax);
         }
         if (wabEntryFlag2 == ParticipantEntryId.WabEntryFlag.OtherFax)
         {
             return(EmailAddressIndex.OtherFax);
         }
     }
     else if (wabEntryFlag2 <= ParticipantEntryId.WabEntryFlag.EmailIndex1)
     {
         if (wabEntryFlag2 == ParticipantEntryId.WabEntryFlag.NoEmailIndex)
         {
             return(EmailAddressIndex.None);
         }
         if (wabEntryFlag2 == ParticipantEntryId.WabEntryFlag.EmailIndex1)
         {
             return(EmailAddressIndex.Email1);
         }
     }
     else
     {
         if (wabEntryFlag2 == ParticipantEntryId.WabEntryFlag.EmailIndex2)
         {
             return(EmailAddressIndex.Email2);
         }
         if (wabEntryFlag2 == ParticipantEntryId.WabEntryFlag.EmailIndex3)
         {
             return(EmailAddressIndex.Email3);
         }
     }
     throw new CorruptDataException(ServerStrings.ExInvalidParticipantEntryId);
 }
Beispiel #5
0
        private static ParticipantEntryId FromEntryId(ParticipantEntryId.WabEntryFlag?wrapperFlags, ParticipantEntryId.Reader reader)
        {
            Guid a = reader.ReadEntryHeader();

            if (a == ParticipantEntryId.OneOffProviderGuid)
            {
                using (ParticipantEntryId.Reader reader2 = reader.TearRest())
                {
                    return(new OneOffParticipantEntryId(reader2));
                }
            }
            if (a == ParticipantEntryId.WabProviderGuid)
            {
                ParticipantEntryId.WabEntryFlag wabEntryFlag = (ParticipantEntryId.WabEntryFlag)reader.ReadByte();
                switch ((byte)(wabEntryFlag & ParticipantEntryId.WabEntryFlag.ObjectTypeMask))
                {
                case 0:
                case 5:
                case 6:
                    break;

                case 1:
                case 2:
                    goto IL_D0;

                case 3:
                case 4:
                    using (ParticipantEntryId.Reader reader3 = reader.TearRest())
                    {
                        return(new StoreParticipantEntryId(wabEntryFlag, reader3));
                    }
                    break;

                default:
                    goto IL_D0;
                }
                if (wrapperFlags != null)
                {
                    throw new CorruptDataException(ServerStrings.ExInvalidParticipantEntryId);
                }
                using (ParticipantEntryId.Reader reader4 = reader.TearRest())
                {
                    return(ParticipantEntryId.FromEntryId(new ParticipantEntryId.WabEntryFlag?(wabEntryFlag), reader4));
                }
IL_D0:
                throw new NotSupportedException(ServerStrings.ExInvalidWABObjectType(wabEntryFlag & ParticipantEntryId.WabEntryFlag.ObjectTypeMask));
            }
            if (a == ParticipantEntryId.ExchangeProviderGuid)
            {
                using (ParticipantEntryId.Reader reader5 = reader.TearRest())
                {
                    return(new ADParticipantEntryId(wrapperFlags, reader5));
                }
            }
            if (a == ParticipantEntryId.OlabProviderGuid)
            {
                using (ParticipantEntryId.Reader reader6 = reader.TearRest())
                {
                    return(new StoreParticipantEntryId(reader6));
                }
            }
            throw new NotSupportedException(ServerStrings.ExUnsupportedABProvider(a.ToString(), string.Empty));
        }