Menu

[r1467]: / trunk / GoogleContactsSync / OutlookExceptionExtensions.cs  Maximize  Restore  History

Download this file

47 lines (43 with data), 1.4 kB

 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
using Serilog;
using System.Runtime.InteropServices;
using Outlook = Microsoft.Office.Interop.Outlook;
namespace GoContactSyncMod
{
public static class OutlookExceptionExtensions
{
public static void ToDebugLog(this Outlook.Exception ex)
{
Log.Debug("** Outlook appointment exception **");
Outlook.AppointmentItem oa = null;
try
{
try
{
oa = ex.AppointmentItem;
}
catch
{
}
Log.Debug(" - Deleted: " + ex.Deleted ?? "null");
Log.Debug(" - OriginalDate: " + ex.OriginalDate ?? "null");
try
{
Log.Debug("** Outlook appointment exception - AppointmentItem **");
oa?.ToDebugLog(printRecurrenceExceptions: false);
Log.Debug("** Outlook appointment exception - AppointmentItem **");
}
catch
{
}
}
finally
{
if (oa != null)
{
Marshal.ReleaseComObject(oa);
}
}
Log.Debug("** Outlook appointment exception **");
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.