/// <summary> /// Creates a new instance of an NdefVcardRecord and imports /// the payload into contact information. /// </summary> /// <param name="record">An NDEF record of type NdefRecord that contains /// valid vCard data as its payload and has the right type information.</param> /// <returns>A new instance of an NdefVcardRecord that internalized the original /// payload into its internal contact data storage.</returns> public async static Task <NdefVcardRecord> CreateFromGenericBaseRecord(NdefRecord record) { var vcardRecord = new NdefVcardRecord(record); await vcardRecord.ParsePayloadToContact(); return(vcardRecord); }
/// <summary> /// Create a new NdefVcardRecord based on an already supplied contact information /// from Windows Phone 8 ContactInformation data. The ContactInformation type is able /// to convert data into the vCard format. /// </summary> /// <param name="contactInfo">ContactInformation to be used for creating this record.</param> /// <param name="vCardFormat">Optionally specify the VCardFormat to use for creating /// the textual payload data.</param> /// <returns>A new instance of an NdefVcardRecord that uses the supplied contact information.</returns> public async static Task <NdefVcardRecord> CreateFromContactInformation(ContactInformation contactInfo, VCardFormat vCardFormat = VCardFormat.Version2_1) { var vcardRecord = new NdefVcardRecord { VCardFormatToWrite = vCardFormat, ContactData = contactInfo }; await vcardRecord.AssemblePayload(); return(vcardRecord); }
/// <summary> /// Create a new NdefVcardRecord based on an already supplied contact information /// from Windows Phone 8 ContactInformation data. The ContactInformation type is able /// to convert data into the vCard format. /// </summary> /// <param name="contactInfo">ContactInformation to be used for creating this record.</param> /// <param name="vCardFormat">Optionally specify the VCardFormat to use for creating /// the textual payload data.</param> /// <returns>A new instance of an NdefVcardRecord that uses the supplied contact information.</returns> public async static Task<NdefVcardRecord> CreateFromContactInformation(ContactInformation contactInfo, VCardFormat vCardFormat = VCardFormat.Version2_1) { var vcardRecord = new NdefVcardRecord { VCardFormatToWrite = vCardFormat, ContactData = contactInfo }; await vcardRecord.AssemblePayload(); return vcardRecord; }
/// <summary> /// Creates a new instance of an NdefVcardRecord and imports /// the payload into contact information. /// </summary> /// <param name="record">An NDEF record of type NdefRecord that contains /// valid vCard data as its payload and has the right type information.</param> /// <returns>A new instance of an NdefVcardRecord that internalized the original /// payload into its internal contact data storage.</returns> public async static Task<NdefVcardRecord> CreateFromGenericBaseRecord(NdefRecord record) { var vcardRecord = new NdefVcardRecord(record); await vcardRecord.ParsePayloadToContact(); return vcardRecord; }