From 755ba91891cf745c973c64bf5c6e5cd0d57b8fca Mon Sep 17 00:00:00 2001 From: Oren Nachman Date: Fri, 22 Oct 2021 10:32:25 +1100 Subject: [PATCH] Debug statement cleanup --- ChimeHelper/ChimeOutlookHelper/ChimeOutlookHelper.cs | 7 ++++--- ChimeHelper/ChimeOutlookHelper/OutlookHelper.cs | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChimeHelper/ChimeOutlookHelper/ChimeOutlookHelper.cs b/ChimeHelper/ChimeOutlookHelper/ChimeOutlookHelper.cs index 525e8b3..31b80af 100644 --- a/ChimeHelper/ChimeOutlookHelper/ChimeOutlookHelper.cs +++ b/ChimeHelper/ChimeOutlookHelper/ChimeOutlookHelper.cs @@ -64,16 +64,17 @@ private static HashSet GetPins(AppointmentItem appointment) { var rv = new List(); - Debug.WriteLine(appointment.Start + " -> " + appointment.End + ": " + appointment.Subject + "\n\tLocation: " + appointment.Location + - "\n\tRequired Attendees: " + appointment.RequiredAttendees + "\n\tOptional Attendees: " + appointment.OptionalAttendees); - rv.AddRange(Chime.GetPinsFromAttendees(appointment.OptionalAttendees)); rv.AddRange(Chime.GetPinsFromAttendees(appointment.RequiredAttendees)); rv.AddRange(Chime.GetPinsFromText(appointment.Location)); rv.AddRange(Chime.GetPinsFromText(appointment.Body)); + /* + Debug.WriteLine(appointment.Start + " -> " + appointment.End + ": " + appointment.Subject + "\n\tLocation: " + appointment.Location + + "\n\tRequired Attendees: " + appointment.RequiredAttendees + "\n\tOptional Attendees: " + appointment.OptionalAttendees); Debug.WriteLine("\tPins: " + string.Join("\n\t", rv)); + */ return new HashSet(rv); } diff --git a/ChimeHelper/ChimeOutlookHelper/OutlookHelper.cs b/ChimeHelper/ChimeOutlookHelper/OutlookHelper.cs index 5bd8bba..09ca9ad 100644 --- a/ChimeHelper/ChimeOutlookHelper/OutlookHelper.cs +++ b/ChimeHelper/ChimeOutlookHelper/OutlookHelper.cs @@ -74,6 +74,10 @@ internal static class OutlookHelper catch (Exception e) { // Not every root folder has a calendar (for example, Public folders), so this exception can be ignored + // This also catches cases where store cannot be retrieved from a specific index (even though the API + // says it is there. In those cases you'll see something like: + // System.Runtime.InteropServices.COMException (0x80040119): Outlook cannot start because a data file to + // send and receive messages cannot be found. Check your settings in this Microsoft Outlook profile. Debug.WriteLine($"Failed to get Calendar for {store?.DisplayName} type: {store?.ExchangeStoreType}:\n{e}"); } } @@ -162,8 +166,6 @@ private static async Task EnsureOutlookIsRunningAsync() foreach (Outlook.AppointmentItem item in restricted) { rv.Add(item); - - Debug.WriteLine("++: " + item.Start + " -> " + item.End + ": " + item.Subject); } return rv;