mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-30 04:04:21 +01:00
* BTCPay Extensions Part 2 This PR cleans up the extension system a bit in that: * It renames the test extension to a more uniform name * Allows yo uto have system extensions, which are extensions but bundled by default with the release (and cannot be removed) * Adds a tool to help you generate an extension package from a csproj * Refactors the UI extension points to a view component * Moves some more interfaces to the Abstractions csproj * Rename to plugins
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using System;
|
|
using System.Reflection;
|
|
using BTCPayServer.Contracts;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace BTCPayServer.Models
|
|
{
|
|
public abstract class BaseBTCPayServerPlugin : IBTCPayServerPlugin
|
|
{
|
|
public abstract string Identifier { get; }
|
|
public abstract string Name { get; }
|
|
|
|
public virtual Version Version
|
|
{
|
|
get
|
|
{
|
|
return Assembly.GetAssembly(GetType())?.GetName().Version ?? new Version(1, 0, 0, 0);
|
|
}
|
|
}
|
|
|
|
public abstract string Description { get; }
|
|
public bool SystemPlugin { get; set; }
|
|
public bool SystemExtension { get; set; }
|
|
public virtual string[] Dependencies { get; } = Array.Empty<string>();
|
|
|
|
public virtual void Execute(IApplicationBuilder applicationBuilder,
|
|
IServiceProvider applicationBuilderApplicationServices)
|
|
{
|
|
}
|
|
|
|
public virtual void Execute(IServiceCollection applicationBuilder)
|
|
{
|
|
}
|
|
}
|
|
}
|