mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
Moved console registration validation into IcdConsole
This commit is contained in:
parent
1927c7df9f
commit
336d229772
1 changed files with 9 additions and 1 deletions
|
|
@ -96,11 +96,19 @@ namespace ICD.Common.Utils
|
|||
#endif
|
||||
}
|
||||
|
||||
public static void AddNewConsoleCommand(Action<string> callback, string command, string help, eAccessLevel accessLevel)
|
||||
public static bool AddNewConsoleCommand(Action<string> callback, string command, string help, eAccessLevel accessLevel)
|
||||
{
|
||||
#if SIMPLSHARP
|
||||
// Avoid crashing Simpl applications
|
||||
if (IcdEnvironment.RuntimeEnvironment == IcdEnvironment.eRuntimeEnvironment.SimplSharp)
|
||||
return false;
|
||||
|
||||
if (CrestronConsole.ConsoleRegistered)
|
||||
return false;
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(str => callback(str), command, help, (ConsoleAccessLevelEnum)(int)accessLevel);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue