MZOutlookAppointmentTools.iCalendarTools 0.9.4

dotnet add package MZOutlookAppointmentTools.iCalendarTools --version 0.9.4                
NuGet\Install-Package MZOutlookAppointmentTools.iCalendarTools -Version 0.9.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MZOutlookAppointmentTools.iCalendarTools" Version="0.9.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MZOutlookAppointmentTools.iCalendarTools --version 0.9.4                
#r "nuget: MZOutlookAppointmentTools.iCalendarTools, 0.9.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MZOutlookAppointmentTools.iCalendarTools as a Cake Addin
#addin nuget:?package=MZOutlookAppointmentTools.iCalendarTools&version=0.9.4

// Install MZOutlookAppointmentTools.iCalendarTools as a Cake Tool
#tool nuget:?package=MZOutlookAppointmentTools.iCalendarTools&version=0.9.4                

MZOutlookAppointmentTools

This library simplifies the creation of recurring Outlook AppointmentItems using standard iCalendar recurrence patterns. It also enables the retrieval of recurrence pattern strings from existing Outlook recurring AppointmentItems. Currently the library provides some tools to parse,generate and compare iCalendar recurrence rules for Outlook appointment items

Limitations

  1. The library currently just supports these recurrence types: "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY". This is because these are the only supported types by Outlook. As a consequence all the related keywords (e.g. "BYHOUR","BYMINUTE","BYSECOND") are not supported.
  2. The "WKST" is not supported as it seems that there are no way to handle it in Outlook.
  3. Patterns containing "BYWEEKNO" are not supported.
  4. Patterns containing BYDAY with numbers such as "FREQ=MONTHLY;INTERVAL=1;BYDAY=1FR,3MO" Are not supported

Supported Pattern Samples

  • "FREQ=WEEKLY;BYDAY=SA"
  • "FREQ=WEEKLY;BYDAY=MO,TU,WE"
  • "FREQ=WEEKLY;BYDAY=MO,TU,WE;INTERVAL=2"
  • "FREQ=MONTHLY;BYMONTHDAY=12"
  • "FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=1"
  • "FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1"
  • "FREQ=YEARLY;BYMONTHDAY=7;BYMONTH=3"
  • "FREQ=YEARLY;BYDAY=FR;BYMONTH=11;BYSETPOS=2"
  • "FREQ=YEARLY;BYDAY=FR;BYMONTH=11;BYSETPOS=3;INTERVAL=3"
  • "FREQ=YEARLY;BYDAY=MO,TU,WE,TH,FR;BYMONTH=9;BYSETPOS=1"

Usage:

SetRecurrencePattern:

 AppointmentItem aItem = (AppointmentItem)ApplicationInstance.CreateItem(OlItemType.olAppointmentItem);
 string pattern = "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR";
 RecurrenceStringTools.SetRecurrencePattern(pattern, aItem, itemStart);
 var recPattern = aItem.GetRecurrencePattern();
//Expected values:
//  recPattern.RecurrenceType == OlRecurrenceType.olRecursWeekly
//  recPattern.DayOfWeekMask == OlDaysOfWeek.olMonday | OlDaysOfWeek.olTuesday | OlDaysOfWeek.olWednesday | OlDaysOfWeek.olThursday | OlDaysOfWeek.olFriday
//  recPattern.Instance == 0
//  recPattern.Interval == 1

GetRecurrencePattern

 AppointmentItem aItem = (AppointmentItem)ApplicationInstance.CreateItem(OlItemType.olAppointmentItem);
 var occ = aItem.GetRecurrencePattern();
 occ.RecurrenceType = OlRecurrenceType.olRecursDaily;
 occ.Interval = 1;
 aItem.Save();
 var item = RecurrenceStringTools.GetRecurrenceString(aItem); // "FREQ=DAILY;INTERVAL=1"

AreEqual

  string pattern1 = "FREQ=WEEKLY;BYDAY=MO,TU,WE";
  string pattern2 = "FREQ=WEEKLY;BYDAY=TU,WE,MO";
  var areEqual = RecurrenceStringTools.AreEqual(pattern1, pattern2);// true

More samples could be found in the test project.

Discution

  1. This pattern "FREQ=MONTHLY;INTERVAL=1;BYDAY=FR" would be converted to a olRecursWeekly as olRecursMonthNth requires the instance field to be set to a value from 1 to 5. So when it is converted back to recurrence rule the value would be simply "FREQ=WEEKLY;INTERVAL=1;BYDAY=FR" (Check these tests: Combo_MonthlyNthSetPos_Existence1 and Combo_MonthlyNthSetPos_Existence2 in RecurrenceStringToolsTest). Moreover, whenever we get the recurrence pattern from an AppointmentItem with olRecursMonthNth, we always include the "BYSETPOS".
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.9.4 76 12/10/2024
0.9.3 81 12/4/2024
0.9.2 91 11/26/2024
0.9.1 88 11/20/2024
0.9.0 80 11/20/2024
0.8.12 85 11/18/2024
0.8.11 89 11/14/2024
0.8.1 84 11/14/2024
0.8.0 84 11/14/2024