instance yuhay + bump version
This commit is contained in:
@@ -1,13 +1,21 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection.Metadata;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Pilz.Plugins.Advanced
|
namespace Pilz.Plugins.Advanced
|
||||||
{
|
{
|
||||||
public interface IPluginFeatureProvider<T> where T : PluginFeature
|
public interface IPluginFeatureProvider
|
||||||
{
|
{
|
||||||
static abstract T Instance { get; }
|
static abstract PluginFeature Instance { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IPluginFeatureProvider<T> : IPluginFeatureProvider where T : PluginFeature, IPluginFeatureProvider<T>
|
||||||
|
{
|
||||||
|
static new abstract T Instance { get; }
|
||||||
|
static PluginFeature IPluginFeatureProvider.Instance => T.Instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||||
<Version>2.6.0</Version>
|
<Version>2.6.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Pilz.UI.Telerik.SymbolFactory\Pilz.UI.Telerik.SymbolFactory.csproj" />
|
<ProjectReference Include="..\Pilz.UI.Telerik.SymbolFactory\Pilz.UI.Telerik.SymbolFactory.csproj" />
|
||||||
|
|||||||
@@ -83,14 +83,14 @@ namespace Pilz.Plugins.Advanced
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
public void Register<T>() where T : IPluginFeatureProvider<PluginFeature>
|
public void Register<TProvider>() where TProvider : IPluginFeatureProvider
|
||||||
{
|
{
|
||||||
Register(T.Instance);
|
Register(TProvider.Instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterAll<T>() where T : IPluginFeaturesProvider
|
public void RegisterAll<TProvider>() where TProvider : IPluginFeaturesProvider
|
||||||
{
|
{
|
||||||
foreach (var feature in T.GetFeatures())
|
foreach (var feature in TProvider.GetFeatures())
|
||||||
Register(feature);
|
Register(feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user