EWSoftware / PDI

A Personal Data Interchange (PDI) library that implements the vCard (RFC 2426), vCalendar, and iCalendar (RFC 2445) specifications including recurrence pattern generation
Microsoft Public License
64 stars 26 forks source link

support for v card 3 and 4 #8

Closed weedkiller closed 4 years ago

weedkiller commented 5 years ago

hi can you add support for vcard 3 and 4

EWSoftware commented 5 years ago

It currently support vCard 2.1 and 3.0. With some minor updates I can add support vCard 4.0 by recognizing the version number. There are changes needed to support new properties and property values as well and to deprecate those no longer relevant to the 4.0 format. For the most part everything else should work as before.

weedkiller commented 5 years ago

great, can you help make it work in graceful or safe mode.. where if the contact doesnt work with one mode it will work with the other, and fall back safe/gracefully. I used another dll before and liked that about that version. I would like to help contribute maybe add some samples. But I dont know how to make it work with android/ios export from a mobile website - when user is on ASP MVC site.

It would help, if you could just add some text on the Wiki, with steps on incorporating your lib in ASP site. Export Vcard, import. Lastly, it would be nice to have export calendar under the same lib, as well. A future req. to keep in mind. 😄

EWSoftware commented 5 years ago

The parser is pretty flexible and will adapt its handling of the properties based on the vCard version it detects.

There is a web demo with examples of uploading and downloading vCard and iCalendar files (online example here). Source is included with the download or (online here in C# and here in VB.NET)

The library help is available online too though it's more for the API rather than using it in specific application scenarios. It can be expanded if you see a need.

Additional examples can also be added though, fair warning, web development isn't really my thing and I have zero experience with mobile development.

weedkiller commented 5 years ago

hi this is aspx, can you please show asp mvc c#.

thanks

EWSoftware commented 5 years ago

I've not done anything with MVC but I assume the underlying concept is the same. You'd receive it as a stream and send the file back as a stream.

For the download, the content type can be changed to "text/vcard" since they have an actual MIME type for it now.

weedkiller commented 5 years ago

ok, that makes sense on the server. But how would it be rendered on the front end, i.e. how would the HTML understand it, is it an image or simply divs/ text fields

EWSoftware commented 5 years ago

I don't think it would be any different than any other object containing data that you want to present to the user for editing. The cards are stored in a collection which can be bound to a list or grid control. Each item in the collection has properties which can be bound to items or bound columns or whatever is equivalent in MVC. For individual cards, the same applies. You can bind properties to textboxes or whatever or manually load and retrieve the values.

EWSoftware commented 5 years ago

Off topic: Are you using VS 2017? Since I'm making updates to the library, I'd like to bring it up to the latest version and use the newer language features but I don't want to leave you behind if you're using an older version.

weedkiller commented 5 years ago

VS 2017, target .NET 4.7.2 your lib will run faster 😸

SeriousM commented 5 years ago

support for vcard v4 would be awesome!

EWSoftware commented 5 years ago

If anyone has some real world examples of vCard 4.0 files they wouldn't mind sharing, please attach them here either individually or in a ZIP file. Names and other personal info can be changed if you don't want that info to be made public.