Beispiel #1
0
        /// <summary>
        /// This static method can be used to load property values into a new vCard collection 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 vCard collection as created from the IO stream</returns>
        /// <example>
        /// <code language="cs">
        /// StreamReader sr = new StreamReader(@"C:\Test.vcf");
        /// VCardCollection vCards1 = VCardParser.ParseFromStream(sr);
        /// sr.Close();
        /// </code>
        /// <code language="vbnet">
        /// Dim sr As New StreamReader("C:\Test.vcf")
        /// Dim vCards1 As VCardCollection = VCardParser.ParseFromStream(sr)
        /// sr.Close()
        /// </code>
        /// </example>
        public static VCardCollection ParseFromStream(TextReader stream)
        {
            VCardParser vcp = new VCardParser();

            vcp.ParseReader(stream);

            return(vcp.VCards);
        }
Beispiel #2
0
        /// <summary>
        /// This static method can be used to load property values into a new vCard collection 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 vCard collection as created from the IO stream</returns>
        /// <example>
        /// <code language="cs">
        /// StreamReader sr = new StreamReader(@"C:\Test.vcf");
        /// VCardCollection vCards1 = VCardParser.ParseFromStream(sr);
        /// sr.Close();
        /// </code>
        /// <code language="vbnet">
        /// Dim sr As New StreamReader("C:\Test.vcf")
        /// Dim vCards1 As VCardCollection = VCardParser.ParseFromStream(sr)
        /// sr.Close()
        /// </code>
        /// </example>
        public static VCardCollection ParseFromStream(TextReader stream)
        {
            VCardParser vcp = new VCardParser();
            vcp.ParseReader(stream);

            return vcp.VCards;
        }