Git Product home page Git Product logo

mixerp.net.vcards's Introduction

MixERP.Net.VCards

VCards is a standard-compliant, lightweight, and forgiving vCard parser written in C# which supports parsing and serializing vCards. The following versions are supported:

  • Version 2.1
  • Version 3.0
  • Version 4.0

How to Use this Library?

Download Nuget Package

Install-Package MixERP.Net.VCards

Create a vCard

var vcard = new VCard
{
    Version = VCardVersion.V4,
    FormattedName = "John Doe",
    FirstName = "John",
    LastName = "Doe",
    Classification = ClassificationType.Confidential,
    Categories = new[] {"Friend", "Fella", "Amsterdam"},
    //...
};

Serialize a vCard and Save as a VCF File

string serialized = vcard.Serialize();
string path = Path.Combine("C:\", "JohnDoe.vcf");
File.WriteAllText(path, serialized);

Parse a VCF File

IEnumerable<VCard> vcards = MixERP.Net.VCards.Deserializer.Deserialize(path);

or

string contents = File.ReadAllText(path, Encoding.UTF8);
IEnumerable<VCard> vcards = MixERP.Net.VCards.Deserializer.GetVCards(contents);

foreach (var vcard in vcards)
{
    Console.WriteLine(vcard.FirstName + " \t " + vcard.MiddleName + " " + vcard.LastName);
    Console.WriteLine(vcard.FormattedName);
}
Console.ReadLine();

Supported V2 Features:

For more info, please see the specifications here

  • Formatted Name (FN string)
  • Last Name (N string)
  • First Name (N string)
  • Middle Name (N string)
  • Prefix (N string)
  • Suffix (N string)
  • BirthDay (BDAY string)
  • Addresses (ADR complex enumerable)
  • Delivery Address (LABEL complex)
  • Telephones (TEL complex enumerable)
  • Emails (EMAIL complex enumerable)
  • Mailer (MAILER string)
  • Title (TITLE string)
  • Role (ROLE string)
  • Time Zone (TITLE TimeZoneInfo)
  • Logo (LOGO string, Base64 Encoded)
  • Photo (PHOTO string, Base64 Encoded)
  • Note (NOTE string)
  • Last Revision (REV DateTime?)
  • Url (URL Uri)
  • Unique Identifier (UID string)
  • Version (VERSION enum)
  • Organization (ORG string)
  • Organizational Unit (ORG string)
  • Longitude (GEO double)
  • Latitude (GEO double)

Supported V3 Features:

For more info, please see the RFC 2426 specifications here

  • Nick Name (NICKNAME string)
  • Categories (CATEGORIES string[])
  • Sort String (SORT-STRING string)
  • Sound (SOUND string, Base64 Encoded)
  • Key (KEY string, Base64 Encoded)
  • Classification (CLASS enum)

Supported V4 Features:

For more info, please see the RFC 6350 specifications here

  • Source (SOURCE Uri)
  • Kind (KIND enum)
  • Anniversary (ANNIVERSARY DateTime?)
  • Gender (GENDER enum)
  • Impps (IMPP complex ienumerable)
  • Languages (LANG complex enumerable)
  • Relations (RELATED complex enumerable)
  • Calendar User Addresses (CALADRURI Uri enumerable)
  • Calendar Addresses (CALURI complex enumerable)

mixerp.net.vcards's People

Contributors

binodnp avatar zoh48gz04 avatar dgwaldo avatar

Watchers

Khanphaphone Vongsavanthong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.