/// <summary> /// Attempts to add the command to the console. /// <para>This must be done in the Control System Constructor.</para> /// </summary> /// <returns>True if it succeeds, false if it fails for any reason.</returns> public bool AddToConsole() { ConsoleAccessLevelEnum level = (ConsoleAccessLevelEnum)CommandAccess; if (CrestronConsole.AddNewConsoleCommand(ExecuteCommand, Name, Help, level)) { return(Manager.RegisterCrestronConsoleCommand(this)); } return(false); }
/// <summary> /// Attempts to add the command to the console. /// <para>This must be done in the Control System Constructor.</para> /// </summary> /// <returns>True if it succeeds, false if it fails for any reason.</returns> public bool AddToConsole() { this.syncRoot.Enter(); try { ConsoleAccessLevelEnum level = (ConsoleAccessLevelEnum)CommandAccess; if (CrestronConsole.AddNewConsoleCommand(ExecuteCommand, Name, Help, level) || CrestronEnvironment.DevicePlatform == eDevicePlatform.Server) { return(Manager.RegisterCrestronConsoleCommand(this)); } return(false); } finally { syncRoot.Leave(); } }
/// <summary> /// Function for the user to add console commands to the system. /// </summary> /// <param name="userFunction">Callback function the command will call.</param> /// <param name="userCmdName">Name of the console command. Spaces are not permitted.</param> /// <param name="userCmdHelp">Information on the console command.</param> /// <param name="userAccess">Authentication level of the command.</param> /// <param name="bIsCommandHidden">If true the command will be hidden and will not show up in help user.</param> /// <returns>true if the operation succeeds; otherwise, false.</returns> /// <exception cref="System.ArgumentException">Verify the Command name does not contain spaces.</exception> /// <exception cref="System.NotSupportedException">This feature is only available in SIMPL# Pro</exception> public static bool AddNewConsoleCommand(SimplSharpProConsoleCmdFunction userFunction, string userCmdName, string userCmdHelp, ConsoleAccessLevelEnum userAccess, bool bIsCommandHidden) { return(CrestronConsole.AddNewConsoleCommand(userFunction, userCmdName, userCmdHelp, userAccess, bIsCommandHidden)); }
public static bool AddNewConsoleCommand(Action <string> action, string name, string help, ConsoleAccessLevelEnum access) { return(AddNewConsoleCommandResult); }