/// <summary> /// Unregisters event handler previously registered with RegisterItemAddEventHandler /// </summary> public void UnRegisterItemAddEventHandler() { if (_itemAddCallback != null) { _folder.Items.ItemAdd -= new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAddEvent); _itemAddCallback = null; } }
/// <summary> /// Unregisters event handler previously registered with RegisterItemAddEventHandler /// </summary> public void UnRegisterItemAddEventHandler() { if (_itemAddCallback != null) { _folder.Items.ItemAdd -= new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAddEvent); _itemAddCallback = null; } }
/// <summary> /// Registers event handler for ItemAdd event for new mail in the folder (i.e. new MailSim.OL.MailItem). /// </summary> /// <param name="callback">public static void FolderEvent(MailItem mail)</param> public void RegisterItemAddEventHandler(FolderItemAddEvent callback) { _itemAddCallback = callback; _folder.Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAddEvent); }
/// <summary> /// Registers event handler for ItemAdd event for new mail in the folder (i.e. new MailSim.OL.MailItem). /// </summary> /// <param name="callback">public static void FolderEvent(MailItem mail)</param> public void RegisterItemAddEventHandler(FolderItemAddEvent callback) { _itemAddCallback = callback; _folder.Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAddEvent); }