Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

VCardDocument

OfficeIMO.Email

Namespace
OfficeIMO.Email
Assembly
OfficeIMO.Email
Source revision
be6c300e4ab1 with working tree changes
Modifiers
sealed

A standalone vCard stream containing one or more ordered VCARD objects.

Inheritance

  • object
  • VCardDocument

Usage

Explore 7 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Constructors

public VCardDocument() #

Creates a document with one vCard 4.0 card.

Methods

public ContentLineComponent AddCard(VCardVersion version = V4_0) #

Adds an empty card with an explicit VERSION property.

Parameters

version OfficeIMO.Email.VCardVersion = V4_0 optional
public ContentLineComponent AddGroup(string formattedName, IEnumerable<string> memberUris) #

Adds an RFC 6350 group card with ordered MEMBER URI properties.

Parameters

formattedName string required
memberUris System.Collections.Generic.IEnumerable<string> required
public static VCardVersion GetVersion(ContentLineComponent card) #

Gets a card's declared syntax version.

Parameters

card OfficeIMO.Email.ContentLineComponent required
Load 3 overloads
public static VCardDocument Load(byte[] bytes, ContentLineReaderOptions? options = null) #

Loads a vCard stream from memory.

Parameters

bytes byte[] required
options OfficeIMO.Email.ContentLineReaderOptions? = null optional
public static VCardDocument Load(string filePath, ContentLineReaderOptions? options = null, CancellationToken cancellationToken = default) #

Loads a vCard file.

Parameters

filePath string required
options OfficeIMO.Email.ContentLineReaderOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static VCardDocument Load(Stream stream, ContentLineReaderOptions? options = null, CancellationToken cancellationToken = default) #

Loads from a caller-owned stream without closing it.

Parameters

stream System.IO.Stream required
options OfficeIMO.Email.ContentLineReaderOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
LoadAsync 2 overloads
public static async Task<VCardDocument> LoadAsync(string filePath, ContentLineReaderOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously loads a vCard file.

Parameters

filePath string required
options OfficeIMO.Email.ContentLineReaderOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<VCardDocument>
public static async Task<VCardDocument> LoadAsync(Stream stream, ContentLineReaderOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously loads from a caller-owned stream without closing it.

Parameters

stream System.IO.Stream required
options OfficeIMO.Email.ContentLineReaderOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<VCardDocument>
public static VCardDocument Parse(string text, ContentLineReaderOptions? options = null) #

Parses a vCard stream from text.

Parameters

text string required
options OfficeIMO.Email.ContentLineReaderOptions? = null optional
Save 2 overloads
public void Save(string filePath, ContentLineWriterOptions? options = null) #

Atomically saves this document to a file.

Parameters

filePath string required
options OfficeIMO.Email.ContentLineWriterOptions? = null optional
public void Save(Stream stream, ContentLineWriterOptions? options = null) #

Saves this document to a caller-owned stream without closing it.

Parameters

stream System.IO.Stream required
options OfficeIMO.Email.ContentLineWriterOptions? = null optional
SaveAsync 2 overloads
public Task SaveAsync(string filePath, ContentLineWriterOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously atomically saves this document to a file.

Parameters

filePath string required
options OfficeIMO.Email.ContentLineWriterOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public Task SaveAsync(Stream stream, ContentLineWriterOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously saves to a caller-owned stream without closing it.

Parameters

stream System.IO.Stream required
options OfficeIMO.Email.ContentLineWriterOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public string Serialize(ContentLineWriterOptions? options = null) #

Serializes this document to text using the configured output encoding.

Parameters

options OfficeIMO.Email.ContentLineWriterOptions? = null optional

Returns

string
public static void SetVersion(ContentLineComponent card, VCardVersion version) #

Replaces a card's declared syntax version.

Parameters

card OfficeIMO.Email.ContentLineComponent required
version OfficeIMO.Email.VCardVersion required
public byte[] ToBytes(ContentLineWriterOptions? options = null) #

Serializes this document to bytes.

Parameters

options OfficeIMO.Email.ContentLineWriterOptions? = null optional

Returns

byte[]
public IReadOnlyList<ContentLineValidationIssue> Validate() #

Validates version-specific stable vCard contracts while retaining extension properties.

Returns

IReadOnlyList<ContentLineValidationIssue>

Properties

public IList<ContentLineComponent> Cards { get; } #

Ordered VCARD roots. Repeated, grouped, unknown, and extension properties are retained.