-
Notifications
You must be signed in to change notification settings - Fork 0
/
OutlookItemsEventsClass1.cs
71 lines (62 loc) · 2.44 KB
/
OutlookItemsEventsClass1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
namespace OutlookEvents
{
/// <summary>
/// Add-in Express Outlook Items Events Class
/// </summary>
public class OutlookItemsEventsClass1 : AddinExpress.MSO.ADXOutlookItemsEvents
{
private AddinModule CurrentModule = null;
public OutlookItemsEventsClass1(AddinExpress.MSO.ADXAddinModule module)
: base(module)
{
if (CurrentModule == null)
CurrentModule = module as AddinModule;
}
public override void ProcessItemAdd(object item)
{
string s = " = ADXOutlookItemsEvents.ItemAdd ";
if ((FolderObj as Outlook.MAPIFolder).EntryID != CurrentModule.OutboxFolderEntryID)
s += CurrentModule.ItemInfo(item);
s += " Parent Folder name is " + (FolderObj as Outlook.MAPIFolder).Name + ".";
CurrentModule.WriteToLog(s, "Node_ProcessItemAdd");
}
public override void ProcessItemChange(object item)
{
string s = " = ADXOutlookItemsEvents.ItemChange ";
if ((FolderObj as Outlook.MAPIFolder).EntryID != CurrentModule.OutboxFolderEntryID)
s += CurrentModule.ItemInfo(item);
s += " Parent Folder name is " + (FolderObj as Outlook.MAPIFolder).Name + ".";
CurrentModule.WriteToLog(s, "Node_ProcessItemChange");
}
public override void ProcessItemRemove()
{
string s = " Parent Folder name is " + (FolderObj as Outlook.MAPIFolder).Name + ".";
CurrentModule.WriteToLog(" = ADXOutlookItemsEvents.ItemRemove" + s, "Node_ProcessItemRemove");
}
public override void ProcessBeforeFolderMove(object moveTo, AddinExpress.MSO.ADXCancelEventArgs e)
{
string s = " = ADXOutlookItemsEvents.BeforeFolderMove. Folder: '";
if (moveTo != null)
s += (moveTo as Outlook.MAPIFolder).Name;
else
s += "null";
s += "'. ";
s += " Parent Folder name is " + (FolderObj as Outlook.MAPIFolder).Name + ".";
CurrentModule.WriteToLog(s, "Node_ProcessBeforeFolderMove");
}
public override void ProcessBeforeItemMove(object item, object moveTo, AddinExpress.MSO.ADXCancelEventArgs e)
{
string s = " = ADXOutlookItemsEvents.BeforeItemMove. ";
s += CurrentModule.ItemInfo(item);
s += " Folder: " + (FolderObj as Outlook.MAPIFolder).Name + ".";
s += " Destination Folder: '";
if (moveTo != null)
s += (moveTo as Outlook.MAPIFolder).Name;
else
s += "null";
s += "'. ";
CurrentModule.WriteToLog(s, "Node_ProcessBeforeItemMove");
}
}
}