/// <summary> /// Loads each iCalendar into our iCalendarCollection. /// </summary> private void Schedule_Load(object sender, EventArgs e) { _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\USHolidays.ics")); _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\lotr.ics")); _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\To-do.ics")); _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\Barça 2006 - 2007.ics")); }
/// <summary> /// Loads each iCalendar into our iCalendarCollection. /// </summary> private void Schedule_Load(object sender, EventArgs e) { try { //IICalendarCollection calendar = iCalendar.LoadFromUri(new Uri(@"http://p03-caldav.icloud.com"), "*****@*****.**", ""); String username = "******"; String password = ""; String caldavUrl = @"https://caldav.icloud.com"; String methodName = "OPTIONS"; ExectueMethod(username, password, caldavUrl, methodName, null, caldavUrl + @" HTTP/1.1", null); WebHeaderCollection headers = new WebHeaderCollection(); headers.Add(@"Translate", "F"); string content = "<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\"><allprop/></propfind>"; ExectueMethod(username, password, caldavUrl, "PROPFIND", headers, content, "text/xml"); } catch (Exception ex) { throw; } _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\USHolidays.ics")); _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\lotr.ics")); _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\To-do.ics")); _Calendars.AddRange(iCalendar.LoadFromFile(@"Calendars\Barça 2006 - 2007.ics")); }
/// <summary> /// Loads and parses the selected calendars. /// </summary> protected void LoadSelectedCalendars() { _Calendars = new iCalendarCollection(); foreach (ListItem li in CalendarList.Items) { // Make sure the item is selected if (li.Selected) { // Load the calendar from the file system _Calendars.AddRange(iCalendar.LoadFromFile(Path.Combine(_CalendarAbsPath, li.Text + @".ics"))); } } }
static Utility() { categoryId = new CategoryController().GetUnCategorizedCategory().Id; calendars = new iCalendarCollection(); object calendarFeeds = GraffitiContext.Current["calendarFeeds"]; if (!String.IsNullOrEmpty(calendarFeeds as String)) { string[] feeds = calendarFeeds.ToString().Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); foreach (string feed in feeds) { calendars.AddRange(iCalendar.LoadFromUri(new Uri(feed))); } } }
/// <summary> /// Loads and parses the selected calendars. /// </summary> protected void LoadSelectedCalendars() { _Calendars = new iCalendarCollection(); foreach (ListItem li in CalendarList.Items) { // Make sure the item is selected if (li.Selected) { // Load the calendar from the file system _Calendars.AddRange(iCalendar.LoadFromFile(Path.Combine(_CalendarAbsPath, li.Text + @".ics"))); } } }