Esempio n. 1
0
        // Token: 0x060013F3 RID: 5107 RVA: 0x000735A4 File Offset: 0x000717A4
        public IEnumerator <AttendeeData> GetEnumerator()
        {
            CalendarItemBase calItem = base.XsoItem as CalendarItemBase;

            if (calItem == null)
            {
                throw new UnexpectedTypeException("CalendarItemBase", base.XsoItem);
            }
            AirSyncDiagnostics.TraceInfo <int, GlobalObjectId>(ExTraceGlobals.XsoTracer, this, "Adding Attendees to meeting request.Count :{0}, GlobalObjectID: {1}", calItem.AttendeeCollection.Count, calItem.GlobalObjectId);
            bool anyAttendeeAdded = false;

            foreach (Attendee attendee in calItem.AttendeeCollection)
            {
                if (!attendee.IsOrganizer)
                {
                    if (attendee.Participant.EmailAddress != null)
                    {
                        anyAttendeeAdded = true;
                        yield return(new AttendeeData(EmailAddressConverter.LookupEmailAddressString(attendee.Participant, calItem.Session.MailboxOwner), attendee.Participant.DisplayName));
                    }
                    else
                    {
                        AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.XsoTracer, this, "Attendee '{0}' skipped because there is no email address. Meeting Subject:'{1}'.", (attendee.Participant.DisplayName == null) ? "<Null>" : attendee.Participant.DisplayName, calItem.Subject);
                    }
                }
            }
            if (!anyAttendeeAdded && !calItem.IsOrganizer() && calItem.IsMeeting && calItem.AttendeeCollection.Count > 0)
            {
                AirSyncDiagnostics.TraceDebug <int, GlobalObjectId, string>(ExTraceGlobals.XsoTracer, this, "No Attendees were added for this meeting, Adding current user as default attendee. Actual Attendees Count: {0}, GlobalObjectId:{1}, Subject:{2}", calItem.AttendeeCollection.Count, calItem.GlobalObjectId, calItem.Subject);
                Command.CurrentCommand.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ExplictlyAddingUserToMeeting");
                MailboxSession session = (MailboxSession)calItem.Session;
                yield return(new AttendeeData(session.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(), session.MailboxOwner.MailboxInfo.DisplayName));
            }
            yield break;
        }
Esempio n. 2
0
        // Token: 0x0600147E RID: 5246 RVA: 0x00076708 File Offset: 0x00074908
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            string  stringData = ((IStringProperty)srcProperty).StringData;
            Contact contact    = base.XsoItem as Contact;

            if (string.IsNullOrEmpty(stringData))
            {
                contact.EmailAddresses.Remove(this.emailIndex);
                return;
            }
            Participant participant = contact.EmailAddresses[this.emailIndex];
            string      text        = null;
            string      text2       = null;

            if (participant != null && !string.IsNullOrEmpty(participant.EmailAddress))
            {
                text2 = EmailAddressConverter.LookupEmailAddressString(participant, contact.Session.MailboxOwner);
                text  = XsoEmailProperty.GetFullEmailString(participant.DisplayName, text2);
                AirSyncDiagnostics.TraceDebug <string, string, string>(ExTraceGlobals.XsoTracer, this, "XSOEmailProperty convertedSmtpAddress :{0}, currentEmail:{1}, RoutingType:{2}", text2, text, participant.RoutingType);
                if (participant.RoutingType == "EX" && text2 == participant.EmailAddress)
                {
                    text2 = SmtpProxyAddress.EncapsulateAddress("EX", participant.EmailAddress, SendMailBase.DefaultDomain);
                    text  = XsoEmailProperty.GetFullEmailString(participant.EmailAddress, text2);
                }
            }
            if (stringData != text && stringData != text2)
            {
                contact.EmailAddresses.Remove(this.emailIndex);
                contact.EmailAddresses.Add(this.emailIndex, EmailAddressConverter.CreateParticipant(stringData));
            }
        }