RelationBuilderAdd(Uri, NullableRel, ActionParameterSection, FuncVCard, String) Method

Adds a RelationProperty instance, which is newly initialized using a Uri that represents a person or organization, to the specified property of the VCard.

Definition

Namespace: FolkerKinzel.VCards.BuilderParts
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public VCardBuilder Add(
	Uri? uri,
	Rel? relationType = null,
	Action<ParameterSection>? parameters = null,
	Func<VCard, string?>? group = null
)

Parameters

uri  Uri
A Uri, or null.
relationType  NullableRel  (Optional)
Standardized description of the relationship with the person or organization that the uri represents. The RelationType property of the added instance will be set to this value.
parameters  ActionParameterSection  (Optional)
An ActionT delegate that's invoked with the ParameterSection of the newly created VCardProperty as argument.
group  FuncVCard, String  (Optional)
A function that returns the identifier of the group of VCardProperty objects, which the VCardProperty should belong to, or null to indicate that the VCardProperty does not belong to any group. The function is called with the VCard instance as argument.

Return Value

VCardBuilder
The VCardBuilder instance that initialized this RelationBuilder to be able to chain calls.

Remarks

If uri is an absolute Uri, a Relation instance containing a ContactID with a Uri value will be created unless uri is a valid "uuid" URN. In this case the ContactID instance will encapsulate its Guid value.

If uri is a relative Uri, its OriginalString will be preserved in a ContactID containing a String value.

The method adds an empty RelationProperty instance if uri is null.

Exceptions

InvalidOperationExceptionThe method has been called on an instance that had been initialized using the default constructor.

See Also