Public Access
Archive completed meeting assistant changes
PR and Push Build/Test / build-and-test (push) Successful in 9m19s
PR and Push Build/Test / build-and-test (push) Successful in 9m19s
This commit is contained in:
@@ -108,6 +108,37 @@ internal static class OutlookClassicCom
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsCanceledAppointment(object appointment)
|
||||
{
|
||||
var meetingStatus = TryGetProperty(appointment, "MeetingStatus");
|
||||
if (meetingStatus is not null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var status = Convert.ToInt32(meetingStatus);
|
||||
if (status is 5 or 7)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception exception) when (exception is FormatException or InvalidCastException or OverflowException)
|
||||
{
|
||||
// Fall back to subject prefixes when Outlook exposes a non-numeric status value.
|
||||
}
|
||||
}
|
||||
|
||||
var subject = Convert.ToString(TryGetProperty(appointment, "Subject")) ?? "";
|
||||
return SubjectIndicatesCancellation(subject);
|
||||
}
|
||||
|
||||
internal static bool SubjectIndicatesCancellation(string subject)
|
||||
{
|
||||
var normalized = subject.TrimStart();
|
||||
return normalized.StartsWith("Canceled:", StringComparison.OrdinalIgnoreCase) ||
|
||||
normalized.StartsWith("Cancelled:", StringComparison.OrdinalIgnoreCase) ||
|
||||
normalized.StartsWith("Abgesagt:", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public static DateTimeOffset ToLocalOffset(DateTime value)
|
||||
{
|
||||
return new DateTimeOffset(DateTime.SpecifyKind(value, DateTimeKind.Local));
|
||||
|
||||
Reference in New Issue
Block a user