Exemple #1
0
        public static ContactManagerBase CreateContactManager(ContactType type)
        {
            ContactManagerBase mgr = null;

            switch (type)
            {
            case (ContactType.Outlook):
                mgr = new OutlookContactManager();
                break;
            }

            return(mgr);
        }
Exemple #2
0
 public static IContactItem CreateContactItem(ContactManagerBase mgr, string fullName, string businessPhone)
 {
     try
     {
         mgr.ToggleSecurityWarning(true);
         IContactItem item = CreateContactItem(mgr);
         item.FullName = fullName;
         item.BusinessTelephoneNumber = businessPhone;
         return(item);
     }
     finally
     {
         mgr.ToggleSecurityWarning(false);
     }
 }
 public static IContactItem CreateContactItem(ContactManagerBase mgr, string fullName, string businessPhone)
 {
     try
     {
         mgr.ToggleSecurityWarning(true);
         IContactItem item = CreateContactItem(mgr);
         item.FullName = fullName;
         item.BusinessTelephoneNumber = businessPhone;
         return item;
     }
     finally
     {
         mgr.ToggleSecurityWarning(false);
     }
 }
Exemple #4
0
        public static IContactItem CreateContactItem(ContactManagerBase mgr, object baseContact)
        {
            try
            {
                mgr.ToggleSecurityWarning(true);
                IContactItem newItem = null;
                if (mgr is OutlookContactManager)
                {
                    OutlookContactManager cmgr = (OutlookContactManager)mgr;

                    if (baseContact == null)
                    {
                        baseContact = cmgr.OutlookApplication.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olContactItem) as Microsoft.Office.Interop.Outlook.ContactItem;
                    }
                    newItem = new OutlookContactItem((Microsoft.Office.Interop.Outlook.ContactItem)baseContact);
                    //newItem.BaseContact = baseContact;
                }
                return(newItem);
            }
            finally
            {
                mgr.ToggleSecurityWarning(false);
            }
        }
        public static IContactItem CreateContactItem(ContactManagerBase mgr, object baseContact)
        {
            try
            {
                mgr.ToggleSecurityWarning(true);
                IContactItem newItem = null;
                if (mgr is OutlookContactManager)
                {
                    OutlookContactManager cmgr = (OutlookContactManager)mgr;

                    if (baseContact == null)
                    {
                        baseContact = cmgr.OutlookApplication.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olContactItem) as Microsoft.Office.Interop.Outlook.ContactItem;
                    }
                    newItem = new OutlookContactItem((Microsoft.Office.Interop.Outlook.ContactItem)baseContact);
                    //newItem.BaseContact = baseContact;
                }
                return newItem;
            }
            finally
            {
                mgr.ToggleSecurityWarning(false);
            }
        }
Exemple #6
0
 public static IContactItem CreateContactItem(ContactManagerBase mgr)
 {
     return(CreateContactItem(mgr, null));
 }
 public static IContactItem CreateContactItem(ContactManagerBase mgr)
 {
     return CreateContactItem(mgr, null);
 }