add feature identifier
This commit is contained in:
@@ -9,19 +9,47 @@ namespace Pilz.Plugins.Advanced
|
||||
{
|
||||
public abstract class PluginFeature
|
||||
{
|
||||
/// <summary>
|
||||
/// The type of the feature defines where the feature get integrated.
|
||||
/// </summary>
|
||||
public string Type { get; init; }
|
||||
/// <summary>
|
||||
/// The identifier of the feature should be uniquie for the current <see cref="Type"/>.
|
||||
/// It defines a feature within a type.
|
||||
/// </summary>
|
||||
public string Identifier { get; init; }
|
||||
/// <summary>
|
||||
/// The full identifier of the feature should be uniquie and is the combination of <see cref="Type"/> and <see cref="Identifier"/>.
|
||||
/// It defines a feature across all types.
|
||||
/// </summary>
|
||||
public string FullIdentifier => GetFullIdentifier(Type, Identifier);
|
||||
/// <summary>
|
||||
/// The (display) name of the feature.
|
||||
/// </summary>
|
||||
public virtual string? Name { get; init; }
|
||||
/// <summary>
|
||||
/// The symbol for the feature.
|
||||
/// </summary>
|
||||
public virtual RadSvgImage? Icon { get; set; }
|
||||
/// <summary>
|
||||
/// Defines if the feature is enabled/visible.
|
||||
/// </summary>
|
||||
public virtual bool Enabled { get; set; } = true;
|
||||
|
||||
protected PluginFeature(string functionType)
|
||||
protected PluginFeature(string featureType, string identifier)
|
||||
{
|
||||
Type = functionType;
|
||||
Identifier = identifier;
|
||||
Type = featureType;
|
||||
}
|
||||
|
||||
protected PluginFeature(string functionType, string? functionName) : this(functionType)
|
||||
protected PluginFeature(string featureType, string featureIdentifier, string? featureName) : this(featureType, featureIdentifier)
|
||||
{
|
||||
Name = functionName;
|
||||
Name = featureName;
|
||||
}
|
||||
|
||||
public static string GetFullIdentifier(string featureType, string identifier)
|
||||
{
|
||||
return $"{featureType}:{identifier}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user