Table of Contents

Class ExtensionAnnotationsAttribute

Namespace
RDCore.SDK.Extensibility.Annotations
Assembly
RDCore.SDK.dll

Says which annotations an extension provides, and where they are described: the registration point of an extension's annotations.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class ExtensionAnnotationsAttribute : Attribute
Inheritance
ExtensionAnnotationsAttribute
Inherited Members

Remarks

An annotation is described by the string of its name in DescriptionsResource, and each of its parameters by the annotation's name and the parameter's joined by an underscore (KeyOf(AnnotationDeclaration, AnnotationParameter)), in each language of the platform (Languages).

What this says is written into the extension's manifest when it is described (Describe(string, string, string?), Annotations), so that a catalogue made from the manifests (AnnotationCatalogue) knows every extension's annotations without starting any of them: an extension that is slow to start, or that has stopped, does not make its annotations unknown.

Constructors

ExtensionAnnotationsAttribute(Type, string)

Says which annotations an extension provides, and where they are described: the registration point of an extension's annotations.

public ExtensionAnnotationsAttribute(Type declarationsType, string descriptionsResource)

Parameters

declarationsType Type

A type of the extension's assembly, with a parameterless constructor, that implements IAnnotationDeclarations.

descriptionsResource string

The base name of the resources of the extension's assembly that describe them: RDCore.Diagnostics.AnnotationDescriptions.

Remarks

An annotation is described by the string of its name in DescriptionsResource, and each of its parameters by the annotation's name and the parameter's joined by an underscore (KeyOf(AnnotationDeclaration, AnnotationParameter)), in each language of the platform (Languages).

What this says is written into the extension's manifest when it is described (Describe(string, string, string?), Annotations), so that a catalogue made from the manifests (AnnotationCatalogue) knows every extension's annotations without starting any of them: an extension that is slow to start, or that has stopped, does not make its annotations unknown.

Properties

DeclarationsType

The type that declares the extension's annotations.

public Type DeclarationsType { get; }

Property Value

Type

DescriptionsResource

The base name of the resources of the extension's assembly that describe the annotations.

public string DescriptionsResource { get; }

Property Value

string

Methods

Read(Assembly)

The annotations an extension's assembly says it provides, with their descriptions in each language of the platform; a description the extension has none of in a language is the one its resources fall back on.

public static AnnotationSet? Read(Assembly assembly)

Parameters

assembly Assembly

The extension's assembly.

Returns

AnnotationSet

The annotations, or null for an assembly that says nothing of any.

Exceptions

InvalidOperationException

The attribute names a type that does not implement IAnnotationDeclarations, or that has no parameterless constructor.

MissingManifestResourceException

The assembly has no resources of the name the attribute gives.