Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

IcsDocument

OfficeIMO.Email

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

A standalone iCalendar stream containing one or more VCALENDAR objects.

Inheritance

  • object
  • IcsDocument

Usage

Explore 6 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 IcsDocument(string productId = "-//OfficeIMO//OfficeIMO.Email//EN") #

Creates a document with one RFC 5545 VCALENDAR object.

Parameters

productId string = "-//OfficeIMO//OfficeIMO.Email//EN" optional

Methods

public ContentLineComponent AddCalendar() #

Adds an empty VCALENDAR root.

public IEnumerable<ContentLineComponent> GetComponents(string name, bool recursive = true) #

Enumerates matching components across every calendar.

Parameters

name string required
recursive bool = true optional

Returns

IEnumerable<ContentLineComponent>
Load 3 overloads
public static IcsDocument Load(byte[] bytes, ContentLineReaderOptions? options = null) #

Loads an iCalendar stream from memory.

Parameters

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

Loads an iCalendar file.

Parameters

filePath string required
options OfficeIMO.Email.ContentLineReaderOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static IcsDocument 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<IcsDocument> LoadAsync(string filePath, ContentLineReaderOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously loads an iCalendar file.

Parameters

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

Returns

Task<IcsDocument>
public static async Task<IcsDocument> 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<IcsDocument>
public static IcsDocument Parse(string text, ContentLineReaderOptions? options = null) #

Parses an iCalendar 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 byte[] ToBytes(ContentLineWriterOptions? options = null) #

Serializes this document to bytes.

Parameters

options OfficeIMO.Email.ContentLineWriterOptions? = null optional

Returns

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

Validates stable RFC 5545 structure without rejecting unknown or extension properties.

Returns

IReadOnlyList<ContentLineValidationIssue>

Properties

public IList<ContentLineComponent> Calendars { get; } #

Ordered VCALENDAR roots. Unknown properties and nested components are retained.