Esempio n. 1
0
 public AddressEntry(object addressEntry)
 {
     m_oif = new OutlookIImplFactory();
     IWSAddressEntry rae = addressEntry as IWSAddressEntry;
     if (rae != null)
     {
         m_redemptionAddressEntry = rae;
     }
     else
     {
         m_outlookAddressEntry = addressEntry as MSOutlook.AddressEntry;
     }
 }
Esempio n. 2
0
 public void Dispose()
 {
     if (m_redemptionAddressEntry != null)
     {
         m_redemptionAddressEntry.Dispose();
         m_redemptionAddressEntry = null;
     }
 }
Esempio n. 3
0
        private bool IsDistributionList(IWSAddressEntry ae)
        {
            try
            {
                // TFS: 7117 (x-int 5746 fast track from 5.23)
                // Occasionally the user's OST file can become corrupt, which means that certain
                // properties on an address entry may throw a COM exception when accessed.
                // A work around is to delete the OST file, as it will be rebuilt.
                // This try-catch will keep us from crashing in these circumstances.
                try
                {
                    return (ae.DisplayType == 1) || (ae.DisplayType == 5); // MapiDefines.DT_DISTLIST || MapiDefines.DT_PRIVATE_DISTLIST
                }
                catch (COMException ex)
                {
                    Logger.LogError("Display Type for address entry is invalid.");
                    Logger.LogError(ex);
                }

                // If the DisplayType property throws an exception then try to determine if this
                // is a distribution list by seeing whether there are any address entry members.
                return ae.Members != null;
            }
            catch (Exception ex)
            {
                Logger.LogError("Unable to determine if address entry is a distribution list");
                Logger.LogError(ex);
            }
            return false;
        }