Exemple #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;
        }
Exemple #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));
            }
        }
Exemple #3
0
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            MessageItem messageItem = (MessageItem)base.XsoItem;

            if (!string.IsNullOrEmpty(((IStringProperty)srcProperty).StringData))
            {
                EmailAddressConverter.SetRecipientCollection(messageItem.Recipients, RecipientItemType.To, ((IStringProperty)srcProperty).StringData);
            }
        }
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            MessageItem messageItem = (MessageItem)base.XsoItem;

            if (!string.IsNullOrEmpty(((IStringProperty)srcProperty).StringData))
            {
                messageItem.From = EmailAddressConverter.CreateParticipant(((IStringProperty)srcProperty).StringData);
            }
        }
 protected override void InternalSetToDefault(IProperty srcProperty)
 {
     if (Command.CurrentCommand.Request.Version >= 160)
     {
         MessageItem messageItem = (MessageItem)base.XsoItem;
         EmailAddressConverter.ClearRecipients(messageItem.Recipients, this.RecipientItemType);
         return;
     }
     base.InternalSetToDefault(srcProperty);
 }
Exemple #6
0
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            MessageItem messageItem = (MessageItem)base.XsoItem;

            messageItem.ReplyTo.Clear();
            IStringProperty stringProperty = (IStringProperty)srcProperty;
            string          stringData     = stringProperty.StringData;

            char[] separator = new char[]
            {
                ',',
                ';'
            };
            foreach (string text in stringData.Split(separator))
            {
                if (!string.IsNullOrEmpty(text))
                {
                    messageItem.ReplyTo.Add(EmailAddressConverter.CreateParticipant(text));
                }
            }
        }
        private string RetrieveOrganizerInfo(Item item)
        {
            if (item == null)
            {
                AirSyncDiagnostics.TraceError(ExTraceGlobals.XsoTracer, this, "Organizer could not be set. No item found.");
                return(null);
            }
            string text  = null;
            string text2 = null;
            string text3 = null;

            try
            {
                text = item.GetValueOrDefault <string>(CalendarItemBaseSchema.OrganizerEmailAddress);
                AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.XsoTracer, this, "OrganizerEmailAddress: {0}", text);
                text2 = item.GetValueOrDefault <string>(CalendarItemBaseSchema.OrganizerType);
                AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.XsoTracer, this, "OrganizerType: {0}", text2);
                text3 = item.GetValueOrDefault <string>(CalendarItemBaseSchema.OrganizerDisplayName);
                AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.XsoTracer, this, "OrganizerDisplayName: {0}", text3);
            }
            catch (PropertyErrorException ex)
            {
                AirSyncDiagnostics.TraceError <string>(ExTraceGlobals.XsoTracer, this, "PropertyErrorException retrieving Organizer info: {0}", ex.Message);
            }
            if (string.IsNullOrEmpty(text))
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.XsoTracer, this, "Organizer could not be set. OrganizerEmailAddress could not be retrieved");
                return(null);
            }
            if (SmtpAddress.IsValidSmtpAddress(text) && !string.Equals(text2, "SMTP".ToString(), StringComparison.InvariantCultureIgnoreCase))
            {
                AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.XsoTracer, this, "Meeting Request Organizer Type is invalid: OrganizerType:{0}. Defaulting to Smtp  RoutingType", text2);
                text2 = "SMTP".ToString();
            }
            Participant participant       = new Participant(text3, text, text2);
            string      participantString = EmailAddressConverter.GetParticipantString(participant, item.Session.MailboxOwner);

            AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.XsoTracer, this, "Meeting Request Organizer: {0}", participantString);
            return(participantString);
        }
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            MessageItem messageItem = (MessageItem)base.XsoItem;

            messageItem.Sender = EmailAddressConverter.CreateParticipant(((IStringProperty)srcProperty).StringData);
        }
        protected override void InternalCopyFromModified(IProperty srcProperty)
        {
            MessageItem messageItem = (MessageItem)base.XsoItem;

            EmailAddressConverter.SetRecipientCollection(messageItem.Recipients, this.RecipientItemType, ((IStringProperty)srcProperty).StringData);
        }