public Collection<MSOutlook.Recipient> GetRecipients(OutlookRecipientTypes type) { Collection<MSOutlook.Recipient> recips = GetRecipientsCache(type); if (null == recips) { Logger.LogDebug("OutlookRecipientTableProxy::GetRecipients Started: type = " + type); recips = new Collection<MSOutlook.Recipient>(); for (int index = 0; index < m_outlookmail.Recipients.Count; ++index) { MSOutlook.Recipient recipient = m_outlookmail.Recipients[index + 1]; if ((null != recipient) && ((int) type == recipient.Type)) { recips.Add(recipient); } } Logger.LogDebug(String.Format(CultureInfo.InvariantCulture, "OutlookRecipientTableProxy::GetRecipients Completed (count={0})", recips.Count)); SetRecipientsCache(type, recips); } return recips; }
private Collection<MSOutlook.Recipient> GetRecipientsCache(OutlookRecipientTypes type) { if (m_bUseCache) { switch (type) { case OutlookRecipientTypes.ToRecipient: return m_toRecipients; case OutlookRecipientTypes.CcRecipient: return m_ccRecipients; case OutlookRecipientTypes.BccRecipient: return m_bccRecipients; } } return null; }
public Collection<IWSRecipient> GetRecipients(OutlookRecipientTypes type) { Collection<IWSRecipient> recips = GetRecipientsCache(type); if( (null == recips) || (recips.Count == 0) ) { Logger.LogDebug("OutlookRecipientTableProxy::GetRecipients Started: type = " + type); using (IWSMail mailItem = m_oif.CreateWSMail(m_outlookmail as Microsoft.Office.Interop.Outlook.MailItem)) { recips = mailItem.GetRecipients((int)type); } SetRecipientsCache(type, recips); } return recips; }
public NameValueCollection GetProcessRecipients(OutlookRecipientTypes type) { NameValueCollection processRecips = GetProcessRecipientsCache(type); if( null == processRecips ) { Logger.LogDebug("OutlookRecipientTableProxy::GetProcessRecipients Started: type = " + type); processRecips = new NameValueCollection(); Collection<IWSRecipient> recipients = GetRecipients(type); foreach( IWSRecipient recipient in recipients ) { processRecips.Add(recipient.AddressEntry.Name, recipient.AddressEntry.Address); } Logger.LogDebug(String.Format(CultureInfo.InvariantCulture, "OutlookRecipientTableProxy::GetProcessRecipients Completed (count={0})", processRecips.Count)); SetProcessRecipientsCache(type, processRecips); } return processRecips; }
private Collection<IWSRecipient> GetRecipientsCache(OutlookRecipientTypes type) { if( m_bUseCache ) { switch( type ) { case OutlookRecipientTypes.ToRecipient: return m_recipsTo; case OutlookRecipientTypes.CcRecipient: return m_recipsCc; case OutlookRecipientTypes.BccRecipient: return m_recipsBcc; default: break; } } return null; }
public int GetCountOfProcessRecipients(OutlookRecipientTypes type) { Collection<IWSRecipient> recipients = GetRecipients(type); return recipients.Count; }
private void SetProcessRecipientsCache(OutlookRecipientTypes type, NameValueCollection recipients) { if( m_bUseCache ) { switch( type ) { case OutlookRecipientTypes.ToRecipient: m_processRecipsTo = recipients; break; case OutlookRecipientTypes.CcRecipient: m_processRecipsCc = recipients; break; case OutlookRecipientTypes.BccRecipient: m_processRecipsBcc = recipients; break; default: break; } } }
private NameValueCollection GetProcessRecipientsCache(OutlookRecipientTypes type) { if( m_bUseCache ) { switch( type ) { case OutlookRecipientTypes.ToRecipient: return m_processRecipsTo; case OutlookRecipientTypes.CcRecipient: return m_processRecipsCc; case OutlookRecipientTypes.BccRecipient: return m_processRecipsBcc; default: break; } } return null; }
private void SetRecipientsCache(OutlookRecipientTypes type, Collection<IWSRecipient> recipients) { if( m_bUseCache ) { switch( type ) { case OutlookRecipientTypes.ToRecipient: m_recipsTo = recipients; break; case OutlookRecipientTypes.CcRecipient: m_recipsCc = recipients; break; case OutlookRecipientTypes.BccRecipient: m_recipsBcc = recipients; break; default: break; } } }
private void SetRecipientsCache(OutlookRecipientTypes type, Collection<MSOutlook.Recipient> recipients) { if (m_bUseCache) { switch (type) { case OutlookRecipientTypes.ToRecipient: m_toRecipients = recipients; break; case OutlookRecipientTypes.CcRecipient: m_ccRecipients = recipients; break; case OutlookRecipientTypes.BccRecipient: m_bccRecipients = recipients; break; } } }
public int GetCountOfProcessRecipients(OutlookRecipientTypes type) { return GetRecipients(type).Count; }