CalendarCollection.GetByUid

CalendarCollection.GetByUid method

Returns a calendar with the specified UID.

public Calendar GetByUid(int uid)
ParameterTypeDescription
uidInt32UID of a calendar.

Return Value

Calendar with a specified UID.

Examples

Shows how to get calendars by name or by id.

var project = new Project(DataDir + "Project5.mpp");

var calendarByName = project.Calendars.GetByName("TestCalendar");
var calendarByUid = project.Calendars.GetByUid(4);

Console.WriteLine("Calendar Name: " + calendarByName.Name);
Console.WriteLine("Calendar Name: " + calendarByUid.Name);
Console.WriteLine("Are calendars equals: " + calendarByName.Equals(calendarByUid));

See Also