How to use
How do you use it?
VisualCard provides two types of versit types:
vCard 2.1, 3.0, 4.0, and 5.0
vCalendar 1.0 and 2.0
vCard 2.1 to 5.0
Just use the CardTools
class found in the VisualCard
namespace that contains all the necessayr tools to get a list of cards from either a vCard file, a stream, or a string representation:
GetCardsFromString(string)
GetCards(string)
GetCards(StreamReader)
These functions return the list of cards from multiple contacts that may be detected by the vCard parser. When parsing is done, it returns an array of Card
instances that hold information about the contact. You can consult the supported parts in the below page:
VisualCard officially supports the vCard 5.0 specification, which can be found here.
To save contacts, call the SaveTo()
function on a Card
instance that holds information about a contact you want to save. Currently, it allows you to specify the method of saving:
SaveTo()
: Saves this contact to a file pathSaveToString()
: Saves this contact to a string representation
On VCard 4.0 and 5.0, ALTID
is supported on all the compatible types. You can also group the properties by appending a group name and a dot before the actual property.
vCalendar 1.0 and 2.0
Currently, support for vCalendar is extremely limited, because it doesn't support anything other than events, but we'll add support for all the components soon to maintain conformance.
Additionally, VisualCard can parse calendars, but only after you've installed a separate library, called VisualCard.Calendar
, that is responsible for handling calendars that are built upon the following vCalendar versions:
vCalendar 1.0
vCalendar 2.0
To parse calendars, you can use the CalendarTools
class that contains the following functions:
GetCalendarsFromString(string)
GetCalendars(string)
GetCalendars(StreamReader)
These functions return the list of cards from multiple contacts that may be detected by the vCard parser. When parsing is done, it returns an array of Card
instances that hold information about the contact. You can consult the supported parts in the below page:
Just like vCards, you can also save calendars by calling the SaveTo()
function on a Calendar
instance that holds information about a calendar you want to save. Currently, it allows you to specify the method of saving:
SaveTo()
: Saves this calemdar to a file pathSaveToString()
: Saves this calendar to a string representation
You can group the properties by appending a group name and a dot before the actual property.
Clipboard support
If you're developing a clipboard manager, you may want to make it detect that it's a vCard or a vCalendar instance using the clipboard object identifier using the FPI
constant variable in either CardTools
or CalendarTools
.
Last updated