Exemplo n.º 1
0
        public static ContactManagerBase CreateContactManager(ContactType type)
        {
            ContactManagerBase mgr = null;
              switch (type)
              {
            case(ContactType.Outlook):
              mgr = new OutlookContactManager();
              break;
              }

              return mgr;
        }
Exemplo n.º 2
0
        public static ContactManagerBase CreateContactManager(ContactType type)
        {
            ContactManagerBase mgr = null;

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

            return(mgr);
        }
Exemplo n.º 3
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);
            }
        }