Example #1
0
 internal static byte[] ToFlatEntryList(ICollection <ParticipantEntryId> entryIds)
 {
     return(ParticipantEntryId.TranslateExceptions <byte[]>(delegate
     {
         byte[] bytes;
         using (ParticipantEntryId.Writer writer = new ParticipantEntryId.Writer())
         {
             writer.Write(entryIds.Count);
             ParticipantEntryId.Bookmark bookmark = writer.PlaceBookmark <int>(new ParticipantEntryId.WriterMethod <int>(writer.Write), 0);
             ParticipantEntryId.Bookmark currentBookmark = writer.CurrentBookmark;
             foreach (ParticipantEntryId participantEntryId in entryIds)
             {
                 if (participantEntryId == null)
                 {
                     throw new ArgumentNullException("entryIds");
                 }
                 ParticipantEntryId.Bookmark bookmark2 = writer.PlaceBookmark <int>(new ParticipantEntryId.WriterMethod <int>(writer.Write), 0);
                 ParticipantEntryId.Bookmark currentBookmark2 = writer.CurrentBookmark;
                 participantEntryId.Serialize(writer);
                 int num = (int)(writer.CurrentBookmark - currentBookmark2);
                 writer.WriteBookmark <int>(bookmark2, num);
                 writer.WritePadding(num, 4);
             }
             writer.WriteBookmark <int>(bookmark, (int)(writer.CurrentBookmark - currentBookmark));
             bytes = writer.GetBytes();
         }
         return bytes;
     }));
 }
        protected override void Serialize(ParticipantEntryId.Writer writer)
        {
            writer.WriteEntryHeader(ParticipantEntryId.OneOffProviderGuid);
            writer.Write((uint)this.flags);
            Encoding encoding = ((this.flags & (OneOffFlag)2147483648U) == (OneOffFlag)2147483648U) ? Encoding.Unicode : CTSGlobals.AsciiEncoding;

            writer.WriteZString(this.emailDisplayName ?? string.Empty, encoding);
            writer.WriteZString(this.emailAddressType ?? string.Empty, encoding);
            writer.WriteZString(this.emailAddress ?? string.Empty, encoding);
        }
Example #3
0
 public byte[] ToByteArray()
 {
     byte[] bytes;
     using (ParticipantEntryId.Writer writer = new ParticipantEntryId.Writer())
     {
         this.Serialize(writer);
         bytes = writer.GetBytes();
     }
     return(bytes);
 }
Example #4
0
        internal StoreObjectId ToUniqueItemId()
        {
            StoreObjectId result;

            using (ParticipantEntryId.Writer writer = new ParticipantEntryId.Writer())
            {
                writer.Write(this.ltEntryId);
                result = StoreObjectId.FromProviderSpecificId(writer.GetBytes(), (this.IsDL == true) ? StoreObjectType.DistributionList : StoreObjectType.Contact);
            }
            return(result);
        }
Example #5
0
 protected override void Serialize(ParticipantEntryId.Writer writer)
 {
     if (this.useWabFormat && this.legacyRecipientDisplayType != null)
     {
         writer.WriteEntryHeader(ParticipantEntryId.WabProviderGuid);
         writer.Write((byte)this.flags);
     }
     writer.WriteEntryHeader(ParticipantEntryId.ExchangeProviderGuid);
     writer.Write(1U);
     writer.Write((uint)(this.legacyRecipientDisplayType ?? LegacyRecipientDisplayType.MailUser));
     writer.WriteZString(this.legacyDN, CTSGlobals.AsciiEncoding);
 }
Example #6
0
 protected override void Serialize(ParticipantEntryId.Writer writer)
 {
     if (this.useWabFormat)
     {
         writer.WriteEntryHeader(ParticipantEntryId.WabProviderGuid);
         writer.Write((byte)(StoreParticipantEntryId.ToWabEntryFlag(this.emailAddressIndex, this.isMapiPDL) | ParticipantEntryId.WabEntryFlag.Outlook));
         writer.Write(this.ltEntryId);
         return;
     }
     writer.WriteEntryHeader(ParticipantEntryId.OlabProviderGuid);
     writer.Write(3U);
     writer.Write(this.isMapiPDL ? 5U : 4U);
     writer.Write(StoreParticipantEntryId.EmailAddressIndexToIndex(this.emailAddressIndex));
     writer.Write(70);
     writer.Write(this.ltEntryId);
 }
 protected override void Serialize(ParticipantEntryId.Writer writer)
 {
     writer.Write(this.entryId);
 }
Example #8
0
 protected abstract void Serialize(ParticipantEntryId.Writer writer);