Ejemplo n.º 1
0
        public IDistListItemWrapper Create(DistListItem inner)
        {
            var wrapper = new TestDistListItemWrapper(_distList.Release, new DistListItemWrapper(inner));

            _distList.Open(wrapper);
            return(wrapper);
        }
 public void Dispose()
 {
     if (_inner != null)
     {
         Marshal.FinalReleaseComObject(_inner);
         _inner = null;
     }
 }
Ejemplo n.º 3
0
        public static List <OutlookSeat> getSeats(AddressEntry addressEntry)
        {
            //https://msdn.microsoft.com/en-us/library/office/ff184624.aspx
            if (addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeUserAddressEntry ||
                addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeRemoteUserAddressEntry ||
                addressEntry.AddressEntryUserType == OlAddressEntryUserType.olSmtpAddressEntry)
            {
                return(new List <OutlookSeat>()
                {
                    new OutlookSeat(addressEntry)
                });
            }

            if (addressEntry.AddressEntryUserType == OlAddressEntryUserType.olExchangeDistributionListAddressEntry)
            {
                List <OutlookSeat> list = new List <OutlookSeat>();
                foreach (AddressEntry member in addressEntry.GetExchangeDistributionList().GetExchangeDistributionListMembers())
                {
                    list.AddRange(getSeats(member));
                }
                return(list);
            }

            if (addressEntry.AddressEntryUserType == OlAddressEntryUserType.olOutlookDistributionListAddressEntry)
            {
                var colContacts = Globals.ThisAddIn.Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts).Items;

                List <OutlookSeat> list = new List <OutlookSeat>();
                foreach (var DL in colContacts)
                {
                    if (DL is DistListItem && (DL as DistListItem).DLName == addressEntry.Name)
                    {
                        DistListItem DLItem = (DL as DistListItem);
                        for (int i = 1; i <= DLItem.MemberCount; i++) //1-based index
                        {
                            Recipient r = DLItem.GetMember(i);        //! do not get the addressentrytype it throws null exception
                            list.Add(new OutlookSeat(r.AddressEntry));
                        }
                    }
                }
                return(list);
            }

            //none of the above
            return(new List <OutlookSeat>());
            //email = recip.PropertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/proptag/0x39FE001E") as string;
        }
 public DistListMatchData(DistListItem entity)
 {
     DlName = entity.DLName;
 }
 public IDistListItemWrapper Create(DistListItem inner)
 {
     return(_inner.Create(inner));
 }
Ejemplo n.º 6
0
 public IDistListItemWrapper Create(DistListItem inner)
 {
     return(new DistListItemWrapper(inner));
 }
 public DistListItemWrapper(DistListItem inner)
 {
     _inner = inner;
 }