25 lines
792 B
C#
25 lines
792 B
C#
namespace Pilz.Plugins.Advanced;
|
|
|
|
public static class Extensions
|
|
{
|
|
public static T? ExecuteIfEnabled<T>(this PluginFunction @this, params object?[]? @params)
|
|
{
|
|
return @this.Enabled ? @this.Execute<T>(@params) : default;
|
|
}
|
|
|
|
public static object? ExecuteIfEnabled(this PluginFunction @this, params object?[]? @params)
|
|
{
|
|
return @this.Enabled ? @this.Execute(@params) : default;
|
|
}
|
|
|
|
public static T? ExecuteIfEnabled<T>(this PluginFunction @this, PluginFunctionSimpleParamter? @params)
|
|
{
|
|
return @this.Enabled ? @this.Execute<T>(@params) : default;
|
|
}
|
|
|
|
public static object? ExecuteIfEnabled(this PluginFunction @this, PluginFunctionParameter? @params)
|
|
{
|
|
return @this.Enabled ? @this.Execute(@params) : default;
|
|
}
|
|
}
|