mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
Update Edit Mode Form ctor check mode
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Netch.Forms.Mode
|
||||
/// <param name="mode">模式</param>
|
||||
public Process(Models.Mode mode = null)
|
||||
{
|
||||
if ((mode?.Type ?? 0) is not 0)
|
||||
if (mode != null && mode.Type is not 0)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Netch.Forms.Mode
|
||||
|
||||
public Route(Models.Mode mode = null)
|
||||
{
|
||||
if ((mode?.Type ?? 1) is not (1 or 2))
|
||||
if (mode != null && mode.Type is not (1 or 2))
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
||||
_mode = mode;
|
||||
|
||||
Reference in New Issue
Block a user