-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add - doc - Added support for vCard 5.0 files
--- We've added support for our own version of vCard 4.0, dubbed vCard 5.0, to VisualCard's parser. Check out the specs in the vcard-50-aptivi.txt file. --- Type: add Breaking: False Doc Required: True Part: 1/1
- Loading branch information
Showing
23 changed files
with
1,314 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,31 @@ public static class ContactData | |
}; | ||
#endregion | ||
|
||
#region singleVcardFiveContactShort | ||
private static readonly string singleVcardFiveContactShort = | ||
""" | ||
BEGIN:VCARD | ||
VERSION:5.0 | ||
N:Hood;Rick;;; | ||
FN:Rick Hood | ||
END:VCARD | ||
""" | ||
; | ||
|
||
private static readonly Card singleVcardFiveContactShortInstance = new | ||
( | ||
null, | ||
"5.0" | ||
) | ||
{ | ||
ContactNames = | ||
[ | ||
new NameInfo(0, [], "Rick", "Hood", [], [], []) | ||
], | ||
ContactFullName = "Rick Hood" | ||
}; | ||
#endregion | ||
|
||
#region singleVcardTwoContact | ||
private static readonly string singleMeCardContact = | ||
""" | ||
|
@@ -376,6 +401,74 @@ public static class ContactData | |
}; | ||
#endregion | ||
|
||
#region singleVcardFiveContact | ||
private static readonly string singleVcardFiveContact = | ||
""" | ||
BEGIN:VCARD | ||
VERSION:5.0 | ||
ADR;TYPE=home:;;Los Angeles\, USA;;;; | ||
EMAIL;TYPE=HOME:[email protected] | ||
FN:John Sanders | ||
IMPP:aim:john.s | ||
N:Sanders;John;;; | ||
NOTE:Note test for VisualCard | ||
ORG:Acme Co. | ||
TEL;TYPE=cell:495-522-3560 | ||
TITLE:Product Manager | ||
X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;JS;1;;;;;;;;;;;;; | ||
X-PHONETIC-FIRST-NAME:Saunders | ||
X-PHONETIC-LAST-NAME:John | ||
SORT-STRING:johnsanders | ||
END:VCARD | ||
""" | ||
; | ||
|
||
private static readonly Card singleVcardFiveContactInstance = new | ||
( | ||
null, | ||
"5.0" | ||
) | ||
{ | ||
ContactNames = | ||
[ | ||
new NameInfo(0, [], "John", "Sanders", [], [], []) | ||
], | ||
ContactFullName = "John Sanders", | ||
ContactTelephones = | ||
[ | ||
new TelephoneInfo(0, [], ["cell"], "495-522-3560") | ||
], | ||
ContactAddresses = | ||
[ | ||
new AddressInfo(0, [], ["home"], "", "", "Los Angeles, USA", "", "", "", "") | ||
], | ||
ContactOrganizations = | ||
[ | ||
new OrganizationInfo(0, [], "Acme Co.", "", "", ["WORK"]) | ||
], | ||
ContactTitles = | ||
[ | ||
new TitleInfo(0, [], "Product Manager") | ||
], | ||
ContactNotes = "Note test for VisualCard", | ||
ContactMails = | ||
[ | ||
new EmailInfo(0, [], ["HOME"], "[email protected]") | ||
], | ||
ContactXNames = | ||
[ | ||
new XNameInfo(0, [], "ANDROID-CUSTOM", ["vnd.android.cursor.item/nickname", "JS", "1", "", "", "", "", "", "", "", "", "", "", "", "", ""], []), | ||
new XNameInfo(0, [], "PHONETIC-FIRST-NAME", ["Saunders"], []), | ||
new XNameInfo(0, [], "PHONETIC-LAST-NAME", ["John"], []) | ||
], | ||
ContactImpps = | ||
[ | ||
new ImppInfo(0, [], "aim:john.s", ["HOME"]) | ||
], | ||
ContactSortString = "johnsanders" | ||
}; | ||
#endregion | ||
|
||
#region multipleVcardTwoContacts | ||
private static readonly string multipleVcardTwoContacts = | ||
""" | ||
|
@@ -833,6 +926,165 @@ public static class ContactData | |
private static readonly Card multipleVcardFourContactsInstanceFour = singleVcardFourContactInstance; | ||
#endregion | ||
|
||
#region multipleVcardFiveContacts | ||
private static readonly string multipleVcardFiveContacts = | ||
""" | ||
BEGIN:VCARD | ||
VERSION:5.0 | ||
FN:Rick Hood | ||
N:Hood;Rick;;; | ||
END:VCARD | ||
BEGIN:VCARD | ||
VERSION:5.0 | ||
ADR;TYPE=work:POBOX;;Street Address ExtAddress;Reg;Loc;Postal;Country | ||
ADR;TYPE=home:;;Street Address;;;; | ||
EMAIL;TYPE=HOME:[email protected] | ||
EMAIL;TYPE=WORK:[email protected] | ||
FN:Neville Navasquillo | ||
IMPP;TYPE=HOME:aim:IM | ||
IMPP;TYPE=HOME:msn:Windows LIVE | ||
IMPP;TYPE=HOME:ymsgr:Yahoo | ||
N:Navasquillo;Neville;Neville\,Nevile;Mr.;Jr. | ||
N;ALTID=0;LANGUAGE=de:NAVASQUILLO;Neville;Neville\,Nevile;Mr.;Jr. | ||
NOTE:Notes | ||
ORG:Organization | ||
TEL;TYPE=work:098-765-4321 | ||
TEL;TYPE=cell:1-234-567-890 | ||
TEL;TYPE=voice:078-494-6434 | ||
TEL;TYPE=home:348-404-8404 | ||
TITLE:Title | ||
X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;NVL.N;1;;;;;;;;;;;;; | ||
END:VCARD | ||
BEGIN:VCARD | ||
VERSION:5.0 | ||
ADR;TYPE=home:;;New York\, USA;;;; | ||
EMAIL;TYPE=HOME:[email protected] | ||
EMAIL;TYPE=WORK:[email protected] | ||
FN:Sarah Santos | ||
N:Santos;Sarah;;; | ||
ORG:Support Scammer Outcry Organization | ||
TEL;TYPE=cell:589-210-1059 | ||
TITLE:Chief Executive Officer | ||
URL:https://sso.org/ | ||
BDAY:19890222 | ||
X-SIP-SIP:sip test | ||
SORT-STRING:sarahsantos | ||
END:VCARD | ||
BEGIN:VCARD | ||
VERSION:5.0 | ||
ADR;TYPE=home:;;Los Angeles\, USA;;;; | ||
EMAIL;TYPE=HOME:[email protected] | ||
FN:John Sanders | ||
IMPP:aim:john.s | ||
N:Sanders;John;;; | ||
NOTE:Note test for VisualCard | ||
ORG:Acme Co. | ||
TEL;TYPE=cell:495-522-3560 | ||
TITLE:Product Manager | ||
X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;JS;1;;;;;;;;;;;;; | ||
X-PHONETIC-FIRST-NAME:Saunders | ||
X-PHONETIC-LAST-NAME:John | ||
SORT-STRING:johnsanders | ||
END:VCARD | ||
""" | ||
; | ||
|
||
private static readonly Card multipleVcardFiveContactsInstanceOne = singleVcardFiveContactShortInstance; | ||
private static readonly Card multipleVcardFiveContactsInstanceTwo = new | ||
( | ||
null, | ||
"5.0" | ||
) | ||
{ | ||
ContactNames = | ||
[ | ||
new NameInfo(0, [], "Neville", "Navasquillo", ["Neville", "Nevile"], ["Mr."], ["Jr."]), | ||
new NameInfo(0, ["LANGUAGE=de"], "Neville", "NAVASQUILLO", ["Neville", "Nevile"], ["Mr."], ["Jr."]) | ||
], | ||
ContactFullName = "Neville Navasquillo", | ||
ContactTelephones = | ||
[ | ||
new TelephoneInfo(0, [], ["work"], "098-765-4321"), | ||
new TelephoneInfo(0, [], ["cell"], "1-234-567-890"), | ||
new TelephoneInfo(0, [], ["voice"], "078-494-6434"), | ||
new TelephoneInfo(0, [], ["home"], "348-404-8404"), | ||
], | ||
ContactAddresses = | ||
[ | ||
new AddressInfo(0, [], ["work"], "POBOX", "", "Street Address ExtAddress", "Reg", "Loc", "Postal", "Country"), | ||
new AddressInfo(0, [], ["home"], "", "", "Street Address", "", "", "", ""), | ||
], | ||
ContactOrganizations = | ||
[ | ||
new OrganizationInfo(0, [], "Organization", "", "", ["WORK"]) | ||
], | ||
ContactTitles = | ||
[ | ||
new TitleInfo(0, [], "Title") | ||
], | ||
ContactNotes = "Notes", | ||
ContactMails = | ||
[ | ||
new EmailInfo(0, [], ["HOME"], "[email protected]"), | ||
new EmailInfo(0, [], ["WORK"], "[email protected]"), | ||
], | ||
ContactXNames = | ||
[ | ||
new XNameInfo(0, [], "ANDROID-CUSTOM", ["vnd.android.cursor.item/nickname", "NVL.N", "1", "", "", "", "", "", "", "", "", "", "", "", "", ""], []), | ||
], | ||
ContactImpps = | ||
[ | ||
new ImppInfo(0, [], "aim:IM", ["HOME"]), | ||
new ImppInfo(0, [], "msn:Windows LIVE", ["HOME"]), | ||
new ImppInfo(0, [], "ymsgr:Yahoo", ["HOME"]) | ||
], | ||
}; | ||
private static readonly Card multipleVcardFiveContactsInstanceThree = new | ||
( | ||
null, | ||
"5.0" | ||
) | ||
{ | ||
ContactNames = | ||
[ | ||
new NameInfo(0, [], "Sarah", "Santos", [], [], []) | ||
], | ||
ContactFullName = "Sarah Santos", | ||
ContactTelephones = | ||
[ | ||
new TelephoneInfo(0, [], ["cell"], "589-210-1059") | ||
], | ||
ContactAddresses = | ||
[ | ||
new AddressInfo(0, [], ["home"], "", "", "New York, USA", "", "", "", "") | ||
], | ||
ContactOrganizations = | ||
[ | ||
new OrganizationInfo(0, [], "Support Scammer Outcry Organization", "", "", ["WORK"]) | ||
], | ||
ContactTitles = | ||
[ | ||
new TitleInfo(0, [], "Chief Executive Officer") | ||
], | ||
ContactURL = "https://sso.org/", | ||
ContactMails = | ||
[ | ||
new EmailInfo(0, [], ["HOME"], "[email protected]"), | ||
new EmailInfo(0, [], ["WORK"], "[email protected]"), | ||
], | ||
ContactXNames = | ||
[ | ||
new XNameInfo(0, [], "SIP-SIP", ["sip test"], []), | ||
], | ||
ContactBirthdate = new DateTime(1989, 2, 22), | ||
ContactSortString = "sarahsantos" | ||
}; | ||
private static readonly Card multipleVcardFiveContactsInstanceFour = singleVcardFiveContactInstance; | ||
#endregion | ||
|
||
#region vcardThreeOldSample | ||
private static readonly string vcardThreeOldSample = | ||
""" | ||
|
@@ -949,6 +1201,7 @@ public static class ContactData | |
singleVcardTwoContactShort, | ||
singleVcardThreeContactShort, | ||
singleVcardFourContactShort, | ||
singleVcardFiveContactShort, | ||
]; | ||
|
||
/// <summary> | ||
|
@@ -959,6 +1212,7 @@ public static class ContactData | |
singleVcardTwoContact, | ||
singleVcardThreeContact, | ||
singleVcardFourContact, | ||
singleVcardFiveContact, | ||
]; | ||
|
||
/// <summary> | ||
|
@@ -969,6 +1223,7 @@ public static class ContactData | |
multipleVcardTwoContacts, | ||
multipleVcardThreeContacts, | ||
multipleVcardFourContacts, | ||
multipleVcardFiveContacts, | ||
]; | ||
|
||
/// <summary> | ||
|
@@ -1005,9 +1260,11 @@ public static readonly (string, string)[] vCardFromMeCardContacts = | |
singleVcardTwoContactShortInstance, | ||
singleVcardThreeContactShortInstance, | ||
singleVcardFourContactShortInstance, | ||
singleVcardFiveContactShortInstance, | ||
singleVcardTwoContactInstance, | ||
singleVcardThreeContactInstance, | ||
singleVcardFourContactInstance, | ||
singleVcardFiveContactInstance, | ||
multipleVcardTwoContactsInstanceOne, | ||
multipleVcardTwoContactsInstanceTwo, | ||
multipleVcardTwoContactsInstanceThree, | ||
|
@@ -1020,6 +1277,10 @@ public static readonly (string, string)[] vCardFromMeCardContacts = | |
multipleVcardFourContactsInstanceTwo, | ||
multipleVcardFourContactsInstanceThree, | ||
multipleVcardFourContactsInstanceFour, | ||
multipleVcardFiveContactsInstanceOne, | ||
multipleVcardFiveContactsInstanceTwo, | ||
multipleVcardFiveContactsInstanceThree, | ||
multipleVcardFiveContactsInstanceFour, | ||
vcardThreeOldSampleInstanceOne, | ||
vcardThreeOldSampleInstanceTwo, | ||
vcardThreeOldSampleInstanceThree, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.