/// <summary> /// This static method can be used to load property values into a new instance of a calendar from a /// <see cref="TextReader"/> derived object such as a <see cref="StreamReader"/> or a <see cref="StringReader"/>. /// </summary> /// <param name="stream">An IO stream from which to read the vCards. It is up to you to open the stream /// with the appropriate text encoding method if necessary.</param> /// <returns>A new calendar as created from the IO stream</returns> /// <example> /// <code language="cs"> /// StreamReader sr = new StreamReader(@"C:\Test.ics"); /// VCalendar vCal1 = VCalendarParser.ParseFromStream(sr); /// sr.Close(); /// </code> /// <code language="vbnet"> /// Dim sr As New StreamReader("C:\Test.ics") /// Dim vCal1 As VCalendar = VCalendarParser.ParseFromStream(sr) /// sr.Close() /// </code> /// </example> public static VCalendar ParseFromStream(TextReader stream) { VCalendarParser vcp = new VCalendarParser(); vcp.ParseReader(stream); return vcp.VCalendar; }