internal static List <BlobRecipient> ReadRecipients(ExTimeZone timeZone, Stream stream)
        {
            List <BlobRecipient> list = new List <BlobRecipient>();

            try
            {
                BinaryReader binaryReader = new BinaryReader(stream);
                uint         num          = binaryReader.ReadUInt32();
                if (num == 1U)
                {
                    uint num2 = binaryReader.ReadUInt32();
                    for (uint num3 = 0U; num3 < num2; num3 += 1U)
                    {
                        BlobRecipient blobRecipient = BlobRecipientParser.ReadRecipient(timeZone, binaryReader);
                        if (blobRecipient == null || blobRecipient.Participant == null)
                        {
                            ExTraceGlobals.StorageTracer.TraceError(0L, "BlobRecipientParser::ReadRecipients. Failed to read a recipient. Skip rest of blob.");
                            break;
                        }
                        list.Add(blobRecipient);
                    }
                }
            }
            catch (EndOfStreamException)
            {
                ExTraceGlobals.StorageTracer.TraceError(0L, "BlobRecipientParser::ReadRecipients. EndOfStream.");
            }
            return(list);
        }
        private static BlobRecipient ReadRecipient(ExTimeZone timeZone, BinaryReader reader)
        {
            BlobRecipient blobRecipient = null;
            uint          num           = reader.ReadUInt32();

            reader.ReadUInt32();
            if (num > 0U)
            {
                blobRecipient = new BlobRecipient(timeZone);
                for (uint num2 = 0U; num2 < num; num2 += 1U)
                {
                    PropTag propTag;
                    object  value;
                    if (!BlobRecipientParser.ReadPropValue(reader, out propTag, out value))
                    {
                        ExTraceGlobals.StorageTracer.TraceError(0L, "BlobRecipientParser::ReadRecipient. Failed reading property.");
                        return(null);
                    }
                    if (propTag.ValueType() != PropType.Error && !propTag.IsNamedProperty())
                    {
                        try
                        {
                            PropertyTagPropertyDefinition propertyDefinition = PropertyTagPropertyDefinition.CreateCustom(propTag.ToString(), (uint)propTag);
                            blobRecipient[propertyDefinition] = value;
                        }
                        catch (InvalidPropertyTypeException ex)
                        {
                            ExTraceGlobals.StorageTracer.TraceError <PropTag, string>(0L, "BlobRecipientParser::ReadRecipient. Failed creating custom property definition for ptag={0}; exception message={1}", propTag, ex.Message);
                            return(null);
                        }
                    }
                }
            }
            return(blobRecipient);
        }
        private void Initialize(MeetingRequest request, string className)
        {
            base.Initialize();
            this.ClassName = className;
            base.Recipients.Add(request.From);
            CalendarItemBase.CopyPropertiesTo(request, this, MeetingForwardNotification.MeetingForwardNotificationProperties);
            List <BlobRecipient> list = new List <BlobRecipient>();

            foreach (Recipient recipient in request.Recipients)
            {
                BlobRecipient item = new BlobRecipient(recipient);
                list.Add(item);
            }
            this.SetForwardedAttendees(list);
            this.Subject = base.GetValueOrDefault <string>(InternalSchema.NormalizedSubjectInternal, string.Empty);
        }
        private static void WriteRecipient(BinaryWriter writer, BlobRecipient recipient)
        {
            List <PropValue> list = new List <PropValue>(recipient.PropertyValues.Count);

            foreach (PropValue item in PropValue.ConvertEnumerator <PropertyDefinition>(recipient.PropertyValues))
            {
                if (!PropertyError.IsPropertyError(item.Value) && !((PropTag)((PropertyTagPropertyDefinition)item.Property).PropertyTag).IsNamedProperty())
                {
                    list.Add(item);
                }
            }
            uint count = (uint)list.Count;
            uint value = 0U;

            writer.Write(count);
            writer.Write(value);
            foreach (PropValue propValue in list)
            {
                PropertyTagPropertyDefinition propertyTagPropertyDefinition = (PropertyTagPropertyDefinition)propValue.Property;
                object value2 = ExTimeZoneHelperForMigrationOnly.ToUtcIfDateTime(propValue.Value);
                BlobRecipientParser.WritePropValue(writer, (PropTag)propertyTagPropertyDefinition.PropertyTag, value2);
            }
        }
        private bool AddAttendee(IAttendeeCollection attendees, Participant organizer, BlobRecipient recipient, ILocationIdentifierSetter locationIdentifierSetter)
        {
            Participant    participant    = recipient.Participant;
            MailboxSession mailboxSession = base.MailboxSession;

            if (Participant.HasSameEmail(participant, organizer, mailboxSession, true))
            {
                return(false);
            }
            foreach (Attendee attendee in attendees)
            {
                if (Participant.HasSameEmail(participant, attendee.Participant, mailboxSession, true))
                {
                    return(false);
                }
            }
            locationIdentifierSetter.SetLocationIdentifier(43893U);
            attendees.Add(participant, AttendeeType.Optional, null, null, false);
            return(true);
        }