mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-23 08:17:47 +01:00
Implement service locator
This commit is contained in:
parent
06b1163a52
commit
ff1d7f2829
101 changed files with 1614 additions and 1436 deletions
25
Dalamud/IoC/Internal/InterfaceVersionAttribute.cs
Normal file
25
Dalamud/IoC/Internal/InterfaceVersionAttribute.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.IoC.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute represents the current version of a module that is loaded in the Service Locator.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
|
||||
internal class InterfaceVersionAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InterfaceVersionAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="version">The current version.</param>
|
||||
public InterfaceVersionAttribute(string version)
|
||||
{
|
||||
this.Version = new(version);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the service version.
|
||||
/// </summary>
|
||||
public Version Version { get; }
|
||||
}
|
||||
}
|
||||
12
Dalamud/IoC/PluginInterfaceAttribute.cs
Normal file
12
Dalamud/IoC/PluginInterfaceAttribute.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.IoC
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute indicates whether the decorated class should be exposed to plugins via IoC.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class PluginInterfaceAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
25
Dalamud/IoC/RequiredVersionAttribute.cs
Normal file
25
Dalamud/IoC/RequiredVersionAttribute.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud.IoC
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute indicates the version of a service module that is required for the plugin to load.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter)]
|
||||
public class RequiredVersionAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequiredVersionAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="version">The required version.</param>
|
||||
public RequiredVersionAttribute(string version)
|
||||
{
|
||||
this.Version = new(version);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the required version.
|
||||
/// </summary>
|
||||
public Version Version { get; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue