Added InternalActionOption in ICommandAction interface.
Updated ConsoleUtilities and removed obsolete functions.
This commit is contained in:
20
PluginManager/Others/Actions/InternalActionOption.cs
Normal file
20
PluginManager/Others/Actions/InternalActionOption.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PluginManager.Others.Actions
|
||||
{
|
||||
public class InternalActionOption
|
||||
{
|
||||
public string OptionName { get; set; }
|
||||
public string OptionDescription { get; set; }
|
||||
|
||||
public InternalActionOption(string optionName, string optionDescription)
|
||||
{
|
||||
OptionName = optionName;
|
||||
OptionDescription = optionDescription;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,8 @@ namespace PluginManager.Others
|
||||
public T0 Item0 { get; }
|
||||
public T1 Item1 { get; }
|
||||
|
||||
public object? Value => Item0 != null ? Item0 : Item1;
|
||||
|
||||
public OneOf(T0 item0)
|
||||
{
|
||||
Item0 = item0;
|
||||
@@ -36,6 +38,11 @@ namespace PluginManager.Others
|
||||
{
|
||||
return Item0 != null ? item0(Item0) : item1(Item1);
|
||||
}
|
||||
|
||||
public Type GetActualType()
|
||||
{
|
||||
return Item0 != null ? Item0.GetType() : Item1.GetType();
|
||||
}
|
||||
}
|
||||
|
||||
public class OneOf<T0, T1, T2>
|
||||
|
||||
Reference in New Issue
Block a user