CalendarCollection

CalendarCollection class

Represents a collection of Calendar objects.

public class CalendarCollection : IList<Calendar>

Properties

Name Description
Count { get; } Gets the number of objects contained in this CalendarCollection object.

Methods

Name Description
Add(string) Adds a new base calendar to this CalendarCollection object and returns added calendar.
Add(string, Calendar) Adds a new calendar with specified base calendar to this CalendarCollection object and returns added calendar.
GetByName(string) Returns a calendar with the specified name.
GetByUid(int) Returns a calendar with the specified UID.
GetEnumerator() Returns an enumerator for this collection.
Remove(Calendar) Removes Calendar from Project CalendarCollection.
ToList() Converts the CalendarCollection object to a list of Calendar objects.

Examples

Shows how to add new calendars.

var project = new Project();

// new calendars can be added to a project's calendar collection by using the collection's Add overloads.
project.Calendars.Add("Calendar");
var newCalendar = project.Calendars.Add("Parent");
project.Calendars.Add("Child", newCalendar);

foreach (var calendar in project.Calendars)
{
    Console.WriteLine("Calendar Name: " + calendar.Name);
}

See Also