public override List <IContactItem> GetAllContacts()
        {
            try
            {
                ToggleSecurityWarning(true);

                Microsoft.Office.Interop.Outlook.Items contactItems = GetBaseContacts();

                List <IContactItem> lst = new List <IContactItem>();

                foreach (Microsoft.Office.Interop.Outlook.ContactItem item in contactItems)
                {
                    lst.Add(ContactItemFactory.CreateContactItem(this, item));
                }
                return(lst);
            }
            catch (System.Exception ex)
            {
                FireContactManagerFailureEvent(ex);
                return(null);
            }
            finally
            {
                ToggleSecurityWarning(false);
            }
        }
        public override IContactItem SearchContact(string phoneNumber, string fullName)
        {
            try
            {
                ToggleSecurityWarning(true);

                Microsoft.Office.Interop.Outlook.Items contactItems = GetBaseContacts();

                string formattedPhone = WOSI.Utilities.StringUtils.FormatPhoneNumber(phoneNumber);
                //string qry = "[BusinessTelephoneNumber] = '{0}' or [FullName] = '{1}' or [BusinessTelephoneNumber] = '{2}'";

                string firstPassQry = String.Format(Query, phoneNumber, fullName);
                Microsoft.Office.Interop.Outlook.ContactItem contactItem = contactItems.Find(firstPassQry) as Microsoft.Office.Interop.Outlook.ContactItem;

                if (contactItem == null)
                {
                    string secondPassQry = String.Format(Query, formattedPhone, fullName);
                    contactItem = contactItems.Find(secondPassQry) as Microsoft.Office.Interop.Outlook.ContactItem;
                }

                IContactItem outlookItem = null;
                if (contactItem != null)
                {
                    outlookItem = ContactItemFactory.CreateContactItem(this, contactItem);
                }

                return(outlookItem);
            }
            catch (System.Exception ex)
            {
                FireContactManagerFailureEvent(ex);
                return(null);
            }
            finally
            {
                ToggleSecurityWarning(false);
            }
        }