mirror of
https://github.com/netchx/netch.git
synced 2026-05-11 23:45:06 +08:00
Enable Nullable
This commit is contained in:
@@ -16,13 +16,13 @@ namespace Netch.Forms.Mode
|
||||
/// <summary>
|
||||
/// 被编辑的模式
|
||||
/// </summary>
|
||||
private readonly Models.Mode _mode;
|
||||
private readonly Models.Mode? _mode;
|
||||
|
||||
/// <summary>
|
||||
/// 编辑模式
|
||||
/// </summary>
|
||||
/// <param name="mode">模式</param>
|
||||
public Process(Models.Mode mode = null)
|
||||
public Process(Models.Mode? mode = null)
|
||||
{
|
||||
if (mode != null && mode.Type is not 0)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Netch.Forms.Mode
|
||||
|
||||
public Item(int value, string text)
|
||||
{
|
||||
Text = text;
|
||||
_text = text;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@ namespace Netch.Forms.Mode
|
||||
public int Value { get; set; }
|
||||
}
|
||||
|
||||
private Item[] _items = {new(1, "Proxy Rule IPs"), new(2, "Bypass Rule IPs")};
|
||||
private readonly Item[] _items = {new(1, "Proxy Rule IPs"), new(2, "Bypass Rule IPs")};
|
||||
|
||||
private readonly Models.Mode _mode;
|
||||
private readonly Models.Mode? _mode;
|
||||
|
||||
public Route(Models.Mode mode = null)
|
||||
public Route(Models.Mode? mode = null)
|
||||
{
|
||||
if (mode != null && mode.Type is not (1 or 2))
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
||||
Reference in New Issue
Block a user