This commit is contained in:
CortexCore
2024-03-31 23:31:00 +08:00
parent e179d2eb53
commit b7b89ee71a
641 changed files with 31286 additions and 22134 deletions

View File

@@ -22,6 +22,11 @@ namespace BITKit
[CustomType(typeof(IValidHandle))]
public sealed class ValidHandle: IValidHandle
{
public override string ToString()
{
return $"Allow:{enableHandle}\nElements:{string.Join("\n",objs)}\nDisableElements:{string.Join("\n",disableObjs)}";
}
public ValidHandle() {}
public ValidHandle(Action<bool> boolDelegate)
{
@@ -36,11 +41,18 @@ namespace BITKit
public bool Allow => this;
private bool enableHandle;
private readonly List<object> objs = new List<object>();
private readonly List<object> disableObjs = new List<object>();
/// <summary>
/// ⚠Dont operate this field directly
/// </summary>
public readonly List<object> objs = new List<object>();
/// <summary>
/// ⚠Dont operate this field directly
/// </summary>
public readonly List<object> disableObjs = new List<object>();
private bool tempEnable;
private Action<bool> EventOnEnableChanged;
public void AddElement(object obj)
{
if (objs.Contains(obj))