• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Build Calendar

Builds an iCalendar calendar with an event and writes it to a file.

Code

using DRIT.Mail.Rfc.ICal;

var builder = new CalendarBuilder();
builder.AddEvent(evt =>
{
    evt.Summary = "Team meeting";
    evt.Start = new System.DateTimeOffset(2026, 7, 27, 10, 0, 0, System.TimeSpan.FromHours(2));
    evt.End = new System.DateTimeOffset(2026, 7, 27, 11, 0, 0, System.TimeSpan.FromHours(2));
    evt.Location = "Conference room A";
    evt.Description = "Weekly team sync.";
});

Calendar calendar = builder.ToCalendar();

using var writer = new CalendarWriter("output.ics");
writer.Write(calendar);

Remarks

CalendarBuilder provides a fluent API for constructing calendars. The resulting Calendar object can be serialized with CalendarWriter.

  • Improve this Doc
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX