Table of Contents

INotableDateAlgorithmPlugin Interface

Definition

Namespace
Bodu.Globalization.Calendar.Plugins
Assembly
Bodu.Globalization.Calendar.Plugins.dll
Package
Bodu.Globalization.Calendar.Plugins 1.0.0
Source
INotableDateAlgorithmPlugin.cs

A plugin that contributes one or more custom INotableDateAlgorithm implementations keyed by algorithm key, which a host registers with a NotableDateAlgorithmRegistry.

public interface INotableDateAlgorithmPlugin : INotableDatePlugin
Inherited Members
Extension Methods

Examples

// The plugin entry point, declared at assembly level.
[assembly: NotableDatePlugin(typeof(ContosoCalendarPlugin))]

public sealed class ContosoCalendarPlugin : INotableDateAlgorithmPlugin
{
    public string Name => "Contoso Calendar";
    public Version Version => new(1, 0, 0);

    public IEnumerable<KeyValuePair<string, INotableDateAlgorithm>> GetAlgorithms()
    {
        yield return new("contoso.march-equinox", new MarchEquinoxAlgorithm());
    }
}

Remarks

Implement this interface on the plugin's entry-point type, declare that type with an assembly-level NotableDatePluginAttribute, and return each algorithm under the key its referencing rules use. A host activates the plugin through NotableDatePluginLoader and registers the algorithms with one of its RegisterAlgorithms overloads.

Methods

GetAlgorithms()

Gets the algorithms the plugin contributes, keyed by the algorithm key a rule references.

IEnumerable<KeyValuePair<string, INotableDateAlgorithm>> GetAlgorithms()

Returns

IEnumerable<KeyValuePair<string, INotableDateAlgorithm>>

The contributed key/algorithm pairs.

Applies to

ProductVersions
.NET8, 10

See Also