ReadInto() public method

Reads a vCard (VCF) file from an input stream.
public ReadInto ( Thought.vCards.vCard card, TextReader reader ) : void
card Thought.vCards.vCard /// An initialized vCard. ///
reader TextReader /// A text reader pointing to the beginning of /// a standard vCard file. ///
return void
Beispiel #1
0
        /// <summary>
        ///     Loads a new instance of the <see cref="vCard"/> class
        ///     from a text reader.
        /// </summary>
        /// <param name="input">
        ///     An initialized text reader.
        /// </param>
        public vCard(TextReader input)
            : this()
        {

            vCardReader reader = new vCardStandardReader();
            reader.ReadInto(this, input);

        }
Beispiel #2
0
        /// <summary>
        ///     Loads a new instance of the <see cref="vCard"/> class
        ///     from a text file.
        /// </summary>
        /// <param name="path">
        ///     The path to a text file containing vCard data in
        ///     any recognized vCard format.
        /// </param>
        public vCard(string path)
            : this()
        {
            using (StreamReader streamReader = new StreamReader(path))
            {
                vCardReader reader = new vCardStandardReader();
                reader.ReadInto(this, streamReader);
            }

        }
Beispiel #3
0
        /// <summary>
        ///     Loads a new instance of the <see cref="vCard"/> class
        ///     from a text file.
        /// </summary>
        /// <param name="path">
        ///     The path to a text file containing vCard data in
        ///     any recognized vCard format.
        /// </param>
        public vCard(string path)
            : this()
        {
            using (StreamReader streamReader = new StreamReader(path))
            {
                vCardReader reader = new vCardStandardReader();
                reader.ReadInto(this, streamReader);
            }

            //String example = "BEGIN:VCARD\nVERSION:3.0\nN:;Saad;;;\nFN:Saad\nTEL;TYPE=CELL:418-271-3874\nTEL;TYPE=HOME:418-524-7721\nEND:VCARD";
            // using (MemoryStream s = GenerateStreamFromString(example))
            //{
            //    vCardReader reader = new vCardStandardReader();
            //    TextReader streamReader = new StreamReader(s, Encoding.Default);
            //    reader.ReadInto(this, streamReader);
            //}
        }