/// <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); }
/// <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); } }
/// <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); //} }
/// <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); }