Class VCardBuilder
Builder for constructing VCard instances for writing.
Inherited Members
Namespace: DRIT.Mail.Rfc.VCard
Assembly: DRIT.Mail.dll
Syntax
public sealed class VCardBuilder
Methods
View SourceAddress(Action<VCardAddressBuilder>)
Adds a delivery address (ADR) configured by the specified callback.
Declaration
public VCardBuilder Address(Action<VCardAddressBuilder> configure)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<VCardAddressBuilder> | configure | Specifies the configure value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Birthday(DateTime)
Sets the birthday (BDAY).
Declaration
public VCardBuilder Birthday(DateTime birthday)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | birthday | Specifies the birthday value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Build()
Builds the VCard.
Declaration
public VCard Build()
Returns
| Type | Description |
|---|---|
| VCard |
Categories(params string[])
Adds categories (CATEGORIES).
Declaration
public VCardBuilder Categories(params string[] categories)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | categories | Specifies the categories value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Classification(VCardClassification?)
Sets the classification (CLASS).
Declaration
public VCardBuilder Classification(VCardClassification? classification)
Parameters
| Type | Name | Description |
|---|---|---|
| VCardClassification? | classification | Specifies the classification value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Email(string, params VCardEmailType[])
Adds an email address (EMAIL) with the specified types.
Declaration
public VCardBuilder Email(string address, params VCardEmailType[] types)
Parameters
| Type | Name | Description |
|---|---|---|
| string | address | Specifies the address value. |
| VCardEmailType[] | types | Specifies the types value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
ExtendedProperty(string, string)
Adds an X-* extension property.
Declaration
public VCardBuilder ExtendedProperty(string name, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name value. |
| string | value | The value to process. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
FormattedName(string)
Sets the formatted display name (FN).
Declaration
public VCardBuilder FormattedName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Geo(double, double)
Sets the geographic position (GEO).
Declaration
public VCardBuilder Geo(double latitude, double longitude)
Parameters
| Type | Name | Description |
|---|---|---|
| double | latitude | Specifies the latitude value. |
| double | longitude | Specifies the longitude value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Name(VCardName?)
Sets the structured name (N) from a VCardName instance.
Declaration
public VCardBuilder Name(VCardName? name)
Parameters
| Type | Name | Description |
|---|---|---|
| VCardName | name | Specifies the name value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Name(string?, string?, string?, string?, string?)
Sets the structured name (N).
Declaration
public VCardBuilder Name(string? family, string? given, string? additional = null, string? prefix = null, string? suffix = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | family | Specifies the family value. |
| string | given | Specifies the given value. |
| string | additional | Specifies the additional value. |
| string | prefix | Specifies the prefix value. |
| string | suffix | Specifies the suffix value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Nicknames(params string[])
Adds nicknames (NICKNAME).
Declaration
public VCardBuilder Nicknames(params string[] nicknames)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | nicknames | Specifies the nicknames value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Note(string?)
Sets the note (NOTE).
Declaration
public VCardBuilder Note(string? note)
Parameters
| Type | Name | Description |
|---|---|---|
| string | note | Specifies the note value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Organization(string?)
Sets the organization (ORG).
Declaration
public VCardBuilder Organization(string? organization)
Parameters
| Type | Name | Description |
|---|---|---|
| string | organization | Specifies the organization value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
PhoneNumber(string, params VCardPhoneType[])
Adds a telephone number (TEL) with the specified types.
Declaration
public VCardBuilder PhoneNumber(string number, params VCardPhoneType[] types)
Parameters
| Type | Name | Description |
|---|---|---|
| string | number | Specifies the number value. |
| VCardPhoneType[] | types | Specifies the types value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Photo(byte[], string)
Sets the photo (PHOTO) with the specified media type.
Declaration
public VCardBuilder Photo(byte[] data, string mediaType)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The data to process. |
| string | mediaType | The media type used by the operation. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
ProductId(string?)
Sets the product identifier (PRODID).
Declaration
public VCardBuilder ProductId(string? productId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | productId | The product id identifier. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Revision(DateTimeOffset)
Sets the last revision timestamp (REV).
Declaration
public VCardBuilder Revision(DateTimeOffset revision)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTimeOffset | revision | Specifies the revision value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Role(string?)
Sets the business role (ROLE).
Declaration
public VCardBuilder Role(string? role)
Parameters
| Type | Name | Description |
|---|---|---|
| string | role | Specifies the role value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
TimeZone(string?)
Sets the timezone (TZ).
Declaration
public VCardBuilder TimeZone(string? timeZone)
Parameters
| Type | Name | Description |
|---|---|---|
| string | timeZone | The time zone used by the operation. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Title(string?)
Sets the job title (TITLE).
Declaration
public VCardBuilder Title(string? title)
Parameters
| Type | Name | Description |
|---|---|---|
| string | title | Specifies the title value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Uid(string?)
Sets the unique identifier (UID).
Declaration
public VCardBuilder Uid(string? uid)
Parameters
| Type | Name | Description |
|---|---|---|
| string | uid | The uid identifier. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Url(string?)
Sets the URL.
Declaration
public VCardBuilder Url(string? url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | Specifies the url value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |
Version(VCardVersion)
Sets the vCard version. Defaults to V30.
Declaration
public VCardBuilder Version(VCardVersion version)
Parameters
| Type | Name | Description |
|---|---|---|
| VCardVersion | version | Specifies the version value. |
Returns
| Type | Description |
|---|---|
| VCardBuilder |