ContentLine Class

A property of a vCard or of an iCalendar component: [group.]NAME;PARAM=value:value ([RFC 6350] 3.3, [RFC 5545] 3.1).

public sealed class ContentLine

Constructors

NameDescription
ContentLine(string, string)Creates a content line.

ContentLine(string, string)

ContentLine.cs

Creates a content line.

public ContentLine(string name, string value)

Parameters

name string
The name of the property, such as TEL or DTSTART.
value string
The value, as it is written (escaped text, a date, a recurrence rule...).

Properties

NameDescription
GroupGets or sets the group of the property (the prefix before a dot, item1.TEL), or null.
NameGets the name of the property, in upper case.
ParametersGets the parameters of the property.
ValueGets or sets the value, as it is written: the text values are escaped (\,, \;, \n). The reader decodes the values of vCard 2.1 in quoted-printable.

Gets or sets the group of the property (the prefix before a dot, item1.TEL), or null.

public string? Group { get; set; }

Property value

string?

Gets the name of the property, in upper case.

public string Name { get; }

Property value

string

Parameters

ContentLine.cs

Gets the parameters of the property.

public IList<ContentLineParameter> Parameters { get; }

Gets or sets the value, as it is written: the text values are escaped (\,, \;, \n). The reader decodes the values of vCard 2.1 in quoted-printable.

public string Value { get; set; }

Property value

string

Methods

NameDescription
DecodeText(string)Decodes an escaped text.
EncodeText(string)Escapes a text: \, ,, ; and the line breaks.
GetComponents()Returns the components of a structured value (separated by ;), decoded as texts.
GetParameter(string)Returns the first value of a parameter.
GetParameterValues(string)Returns the values of a parameter.
GetText()Returns the value decoded as a text: \n is a line break, \,, \; and \\ are the characters.
GetTypes()Returns the types of the property: the values of the TYPE parameters and the parameters of vCard 2.1 without a name, in lower case.
GetValues()Returns the values of a value list (separated by ,), decoded as texts.
SetParameter(string, string?)Sets a parameter, or removes it when the value is null.
ToString()Returns the content line as it is written, without folding.

DecodeText(string)

ContentLine.cs

Decodes an escaped text.

public static string DecodeText(string value)

Parameters

value string
The escaped text.

Returns

string The text.

EncodeText(string)

ContentLine.cs

Escapes a text: \, ,, ; and the line breaks.

public static string EncodeText(string value)

Parameters

value string
The text.

Returns

string The escaped text.

GetComponents()

ContentLine.cs

Returns the components of a structured value (separated by ;), decoded as texts.

public IReadOnlyList<string> GetComponents()

Returns

IReadOnlyList<string> The components.

GetParameter(string)

ContentLine.cs

Returns the first value of a parameter.

public string? GetParameter(string name)

Parameters

name string
The name of the parameter, without case.

Returns

string? The value, or null when the property does not have the parameter.

GetParameterValues(string)

ContentLine.cs

Returns the values of a parameter.

public IReadOnlyList<string> GetParameterValues(string name)

Parameters

name string
The name of the parameter, without case.

Returns

IReadOnlyList<string> The values; empty when the property does not have the parameter.

Returns the value decoded as a text: \n is a line break, \,, \; and \\ are the characters.

public string GetText()

Returns

string The text.

GetTypes()

ContentLine.cs

Returns the types of the property: the values of the TYPE parameters and the parameters of vCard 2.1 without a name, in lower case.

public IReadOnlyList<string> GetTypes()

Returns

IReadOnlyList<string> The types.

GetValues()

ContentLine.cs

Returns the values of a value list (separated by ,), decoded as texts.

public IReadOnlyList<string> GetValues()

Returns

IReadOnlyList<string> The values.

SetParameter(string, string?)

ContentLine.cs

Sets a parameter, or removes it when the value is null.

public void SetParameter(string name, string? value)

Parameters

name string
The name of the parameter.
value string?
The value.

ToString()

ContentLine.cs

Returns the content line as it is written, without folding.

public override string ToString()

Returns

string The content line.