public static ContactManagerBase CreateContactManager(ContactType type) { ContactManagerBase mgr = null; switch (type) { case(ContactType.Outlook): mgr = new OutlookContactManager(); break; } return mgr; }
public static ContactManagerBase CreateContactManager(ContactType type) { ContactManagerBase mgr = null; switch (type) { case (ContactType.Outlook): mgr = new OutlookContactManager(); break; } return(mgr); }
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); } }