• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class VCard

A vCard (RFC 6350, RFC 2426, informal 2.1). Immutable after parsing. Construct via VCardBuilder for writing.

Inheritance
object
VCard
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.VCard
Assembly: DRIT.Mail.dll
Syntax
public sealed class VCard

Constructors

View Source

VCard(VCardVersion, string?, VCardName?, IReadOnlyList<string>, byte[]?, string?, DateTime?, IReadOnlyList<VCardAddress>, IReadOnlyList<VCardPhoneNumber>, IReadOnlyList<VCardEmail>, string?, VCardGeo?, string?, string?, string?, IReadOnlyList<string>, string?, string?, DateTimeOffset?, string?, string?, VCardClassification?, IReadOnlyList<VCardProperty>, IReadOnlyList<VCardProperty>)

Initializes a new instance of the VCard class.

Declaration
public VCard(VCardVersion version, string? formattedName, VCardName? name, IReadOnlyList<string> nicknames, byte[]? photo, string? photoMediaType, DateTime? birthday, IReadOnlyList<VCardAddress> addresses, IReadOnlyList<VCardPhoneNumber> phoneNumbers, IReadOnlyList<VCardEmail> emails, string? timeZone, VCardGeo? geo, string? title, string? role, string? organization, IReadOnlyList<string> categories, string? note, string? productId, DateTimeOffset? revision, string? uid, string? url, VCardClassification? classification, IReadOnlyList<VCardProperty> extendedProperties, IReadOnlyList<VCardProperty> allProperties)
Parameters
Type Name Description
VCardVersion version
string formattedName
VCardName name
IReadOnlyList<string> nicknames
byte[] photo
string photoMediaType
DateTime? birthday
IReadOnlyList<VCardAddress> addresses
IReadOnlyList<VCardPhoneNumber> phoneNumbers
IReadOnlyList<VCardEmail> emails
string timeZone
VCardGeo geo
string title
string role
string organization
IReadOnlyList<string> categories
string note
string productId
DateTimeOffset? revision
string uid
string url
VCardClassification? classification
IReadOnlyList<VCardProperty> extendedProperties
IReadOnlyList<VCardProperty> allProperties

Properties

View Source

Addresses

Gets the delivery addresses (ADR). May be empty.

Declaration
public IReadOnlyList<VCardAddress> Addresses { get; }
Property Value
Type Description
IReadOnlyList<VCardAddress>
View Source

AllProperties

Gets all raw properties in source order, including those covered by the typed accessors. Use this for round-tripping or for properties not in the typed model.

Declaration
public IReadOnlyList<VCardProperty> AllProperties { get; }
Property Value
Type Description
IReadOnlyList<VCardProperty>
View Source

Birthday

Gets the birthday (BDAY), or null if not specified.

Declaration
public DateTime? Birthday { get; }
Property Value
Type Description
DateTime?
View Source

Categories

Gets the categories (CATEGORIES). May be empty.

Declaration
public IReadOnlyList<string> Categories { get; }
Property Value
Type Description
IReadOnlyList<string>
View Source

Classification

Gets the classification (CLASS), or null if not specified.

Declaration
public VCardClassification? Classification { get; }
Property Value
Type Description
VCardClassification?
View Source

Emails

Gets the email addresses (EMAIL). May be empty.

Declaration
public IReadOnlyList<VCardEmail> Emails { get; }
Property Value
Type Description
IReadOnlyList<VCardEmail>
View Source

ExtendedProperties

Gets the X-* extension properties. May be empty.

Declaration
public IReadOnlyList<VCardProperty> ExtendedProperties { get; }
Property Value
Type Description
IReadOnlyList<VCardProperty>
View Source

FormattedName

Gets the formatted display name (FN), or null if not specified.

Declaration
public string? FormattedName { get; }
Property Value
Type Description
string
View Source

Geo

Gets the geographic position (GEO), or null if not specified.

Declaration
public VCardGeo? Geo { get; }
Property Value
Type Description
VCardGeo
View Source

Name

Gets the structured name (N), or null if not specified.

Declaration
public VCardName? Name { get; }
Property Value
Type Description
VCardName
View Source

Nicknames

Gets the nicknames (NICKNAME). May be empty.

Declaration
public IReadOnlyList<string> Nicknames { get; }
Property Value
Type Description
IReadOnlyList<string>
View Source

Note

Gets the note (NOTE), or null if not specified.

Declaration
public string? Note { get; }
Property Value
Type Description
string
View Source

Organization

Gets the organization (ORG), or null if not specified.

Declaration
public string? Organization { get; }
Property Value
Type Description
string
View Source

PhoneNumbers

Gets the telephone numbers (TEL). May be empty.

Declaration
public IReadOnlyList<VCardPhoneNumber> PhoneNumbers { get; }
Property Value
Type Description
IReadOnlyList<VCardPhoneNumber>
View Source

Photo

Gets the photo data (PHOTO), or null if not specified.

Declaration
public byte[]? Photo { get; }
Property Value
Type Description
byte[]
View Source

PhotoMediaType

Gets the photo media type (e.g. image/jpeg), or null if not specified.

Declaration
public string? PhotoMediaType { get; }
Property Value
Type Description
string
View Source

ProductId

Gets the product identifier (PRODID), or null if not specified.

Declaration
public string? ProductId { get; }
Property Value
Type Description
string
View Source

Revision

Gets the last revision timestamp (REV), or null if not specified.

Declaration
public DateTimeOffset? Revision { get; }
Property Value
Type Description
DateTimeOffset?
View Source

Role

Gets the business role (ROLE), or null if not specified.

Declaration
public string? Role { get; }
Property Value
Type Description
string
View Source

TimeZone

Gets the timezone (TZ), or null if not specified.

Declaration
public string? TimeZone { get; }
Property Value
Type Description
string
View Source

Title

Gets the job title (TITLE), or null if not specified.

Declaration
public string? Title { get; }
Property Value
Type Description
string
View Source

Uid

Gets the unique identifier (UID), or null if not specified.

Declaration
public string? Uid { get; }
Property Value
Type Description
string
View Source

Url

Gets the URL, or null if not specified.

Declaration
public string? Url { get; }
Property Value
Type Description
string
View Source

Version

Gets the vCard version.

Declaration
public VCardVersion Version { get; }
Property Value
Type Description
VCardVersion

Methods

View Source

Load(Stream)

Loads a single VCard from the specified stream. If the stream contains multiple vCards, the first is returned.

Declaration
public static VCard Load(Stream stream)
Parameters
Type Name Description
Stream stream

The stream used to read or write the data.

Returns
Type Description
VCard
View Source

Load(string)

Loads a single VCard from the specified file. If the file contains multiple vCards, the first is returned.

Declaration
public static VCard Load(string fileName)
Parameters
Type Name Description
string fileName

The file or path to process.

Returns
Type Description
VCard
View Source

LoadAll(Stream)

Loads all vCards from the specified stream.

Declaration
public static IReadOnlyList<VCard> LoadAll(Stream stream)
Parameters
Type Name Description
Stream stream

The stream used to read or write the data.

Returns
Type Description
IReadOnlyList<VCard>
View Source

LoadAll(string)

Loads all vCards from the specified file.

Declaration
public static IReadOnlyList<VCard> LoadAll(string fileName)
Parameters
Type Name Description
string fileName

The file or path to process.

Returns
Type Description
IReadOnlyList<VCard>
View Source

Write(Stream, VCardVersion?)

Writes this vCard to the specified stream.

Declaration
public void Write(Stream stream, VCardVersion? version = null)
Parameters
Type Name Description
Stream stream

The destination stream.

VCardVersion? version

The version to write. If null, the version of this vCard is used.

View Source

Write(string, VCardVersion?)

Writes this vCard to the specified file.

Declaration
public void Write(string fileName, VCardVersion? version = null)
Parameters
Type Name Description
string fileName

The destination file name.

VCardVersion? version

The version to write. If null, the version of this vCard is used.

  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX