|
@@ -1,238 +1,242 @@
|
|
|
-using System;
|
|
|
|
|
-using System.Collections.Generic;
|
|
|
|
|
-using System.Linq;
|
|
|
|
|
-using System.Reflection;
|
|
|
|
|
-using System.Xml.XPath;
|
|
|
|
|
-using Quadarax.Foundation.Core.Console;
|
|
|
|
|
-using Quadarax.Foundation.Core.Logging;
|
|
|
|
|
-using Quadarax.Foundation.Core.QConsole.Handlers;
|
|
|
|
|
-
|
|
|
|
|
-namespace Quadarax.Foundation.Core.QConsole.Configuration
|
|
|
|
|
-{
|
|
|
|
|
- public class StartupConfiguration
|
|
|
|
|
- {
|
|
|
|
|
- #region *** Private Fields ***
|
|
|
|
|
- private bool _isConsoleDebug;
|
|
|
|
|
- private string[] _defaultCommands = {"CmdClear", "CmdExit", "CmdPrint", "CmdSelection"};
|
|
|
|
|
-
|
|
|
|
|
- private readonly IList<string> _disabledCommands = new List<string>();
|
|
|
|
|
- #endregion
|
|
|
|
|
-
|
|
|
|
|
- #region *** Properties ***
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Name of console application, If not defined uses default name from entryAssembly.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string ConsoleName { get; } = string.Empty;
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Console application version. If not defined uses version of entryAssembly.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public Version ConsoleVersion { get; } = Version.Parse("0.0.0.0");
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Console application copyright message. If not set skip this info.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string ConsoleCopyright { get; set; } = string.Empty;
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Defines if console is initialized from XML definition.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public bool IsInitFromXml { get; }
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Left introducing of interactive mode character.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string CharacterLineIntroduce { get; set; } = string.Empty;
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Separator between two ordinal arguments
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string CharacterOrdinalArgumentSeparator { get; set; } = string.Empty;
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Named argument prefix character.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string CharacterNamedArgumentSeparator { get; set; } = string.Empty;
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Named argument postfix character {defines end of argument code and value)
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string CharacterNamedArgumentValueSeparator { get; set; } = string.Empty;
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Start end end string value character
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string CharacterTextValueBraceSeparator { get; set; } = string.Empty;
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Separator between two selection inputs
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string CharacterSelectionInputValueSeparator { get; set; } = string.Empty;
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Date input/output value format
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string DateFormat { get; set; } = string.Empty;
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Time input/output value format
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string TimeFormat { get; set; } = string.Empty;
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Defines if interactive mode is enabled
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public bool AllowInteractive { get; set; }
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Defines if initial variables is allowed for interactive mode.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public bool AllowPreset { get; set; }
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Defines assembly list where custom commands are defined (in case explicit command definition).
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public Assembly[] CommandDefinitionAssembly { get; set; } = Array.Empty<Assembly>();
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Returns name of command classes that will be disabled (hidden)
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public string[] DisabledCommands => _disabledCommands.ToArray();
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Defines if waits on key at the end of process in non-interactive mode (inline mode)
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public bool WaitOnKeyInNonInteractiveMode { get; set; }
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Defines if show status of engine and command context before every command executed.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public bool ShowStatusOnEveryCommand { get; set; }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- public bool UseDefaultHandlers { get; set; }
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// Handler when no arguments input specified. If not set then do nothing.
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- public NothingToDo? HandlerNothingToDo { get; set; }
|
|
|
|
|
-
|
|
|
|
|
- public bool IsConsoleDebug {
|
|
|
|
|
- get
|
|
|
|
|
- {
|
|
|
|
|
- return _isConsoleDebug;
|
|
|
|
|
- }
|
|
|
|
|
- set
|
|
|
|
|
- {
|
|
|
|
|
- _isConsoleDebug = value;
|
|
|
|
|
- DebugConsoleWriter.IsWriteDebugEnabled = value;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public ILogger? DefaultLoggerFactory { get; set; }
|
|
|
|
|
- #endregion
|
|
|
|
|
-
|
|
|
|
|
- #region *** Constructor ***
|
|
|
|
|
-
|
|
|
|
|
- public StartupConfiguration(string consoleName, Version consoleVersion)
|
|
|
|
|
- {
|
|
|
|
|
- ConsoleName = consoleName;
|
|
|
|
|
- ConsoleVersion = consoleVersion;
|
|
|
|
|
- IsInitFromXml = false;
|
|
|
|
|
- InitDefaults();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public StartupConfiguration(string consoleXmlFileName)
|
|
|
|
|
- {
|
|
|
|
|
- IsInitFromXml = true;
|
|
|
|
|
- InitDefaults();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public StartupConfiguration(XPathNavigator configurationNavigator)
|
|
|
|
|
- {
|
|
|
|
|
- IsInitFromXml = true;
|
|
|
|
|
- InitDefaults();
|
|
|
|
|
- }
|
|
|
|
|
- #endregion
|
|
|
|
|
-
|
|
|
|
|
- #region *** Public Operations ***
|
|
|
|
|
- public StartupConfiguration EnableDebugMode()
|
|
|
|
|
- {
|
|
|
|
|
- IsConsoleDebug = true;
|
|
|
|
|
- return this;
|
|
|
|
|
- }
|
|
|
|
|
- public StartupConfiguration DisableDebugMode()
|
|
|
|
|
- {
|
|
|
|
|
- IsConsoleDebug = false;
|
|
|
|
|
- return this;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public StartupConfiguration DisableDefaultCommands()
|
|
|
|
|
- {
|
|
|
|
|
- return DisableCommands(_defaultCommands);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public StartupConfiguration EnableDefaultCommands()
|
|
|
|
|
- {
|
|
|
|
|
- return EnableCommands(_defaultCommands);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public StartupConfiguration EnableCommands(params string[]? commandClassNames)
|
|
|
|
|
- {
|
|
|
|
|
- if (commandClassNames == null)
|
|
|
|
|
- return this;
|
|
|
|
|
-
|
|
|
|
|
- foreach (var className in commandClassNames)
|
|
|
|
|
- {
|
|
|
|
|
- if (_disabledCommands.Contains(className))
|
|
|
|
|
- _disabledCommands.Remove(className);
|
|
|
|
|
- }
|
|
|
|
|
- return this;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public StartupConfiguration DisableCommands(params string[]? commandClassNames)
|
|
|
|
|
- {
|
|
|
|
|
- if (commandClassNames == null)
|
|
|
|
|
- return this;
|
|
|
|
|
- foreach (var className in commandClassNames)
|
|
|
|
|
- {
|
|
|
|
|
- if (!_disabledCommands.Contains(className))
|
|
|
|
|
- _disabledCommands.Add(className);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return this;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- #endregion
|
|
|
|
|
-
|
|
|
|
|
- #region *** Private Operations ***
|
|
|
|
|
- private void InitDefaults()
|
|
|
|
|
- {
|
|
|
|
|
- CharacterLineIntroduce = Defaults.RoleCharacters.ConsoleLineIntroduce;
|
|
|
|
|
- CharacterOrdinalArgumentSeparator = Defaults.RoleCharacters.OrdinalArgumentSeparator;
|
|
|
|
|
- CharacterNamedArgumentSeparator = Defaults.RoleCharacters.NamedArgumentSeparator;
|
|
|
|
|
- CharacterNamedArgumentValueSeparator = Defaults.RoleCharacters.NamedArgumentValueSeparator;
|
|
|
|
|
- CharacterTextValueBraceSeparator = Defaults.RoleCharacters.TextValueBraceSeparator;
|
|
|
|
|
- CharacterSelectionInputValueSeparator = Defaults.RoleCharacters.InputSelectionValueSeparator;
|
|
|
|
|
-
|
|
|
|
|
- DateFormat = Defaults.Formats.DateFormat;
|
|
|
|
|
- TimeFormat = Defaults.Formats.TimeFormat;
|
|
|
|
|
-
|
|
|
|
|
- AllowInteractive = Defaults.Console.InteractiveAllowed;
|
|
|
|
|
- AllowPreset = Defaults.Console.PresetAllowed;
|
|
|
|
|
- IsConsoleDebug = Defaults.Console.ConsoleDebugMode;
|
|
|
|
|
- WaitOnKeyInNonInteractiveMode = Defaults.Console.WaitOnKeyInNonInteractiveMode;
|
|
|
|
|
- ShowStatusOnEveryCommand = Defaults.Console.ShowStatusOnEveryCommand;
|
|
|
|
|
- UseDefaultHandlers = Defaults.Console.UseDefaultHadlers;
|
|
|
|
|
-
|
|
|
|
|
- if (UseDefaultHandlers)
|
|
|
|
|
- {
|
|
|
|
|
- HandlerNothingToDo += engine =>
|
|
|
|
|
- {
|
|
|
|
|
- using (var writer = new ConsoleWriter(ConsoleColor.Yellow))
|
|
|
|
|
- {
|
|
|
|
|
- writer.WriteLine("Nothing to do.");
|
|
|
|
|
- }
|
|
|
|
|
- using (var writer = new ConsoleWriter(ConsoleColor.DarkGreen))
|
|
|
|
|
- {
|
|
|
|
|
- writer.WriteLine("Put some arguments to do something. For example -help to list commands and arguments.");
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- #endregion
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+using System;
|
|
|
|
|
+using System.Collections.Generic;
|
|
|
|
|
+using System.Linq;
|
|
|
|
|
+using System.Reflection;
|
|
|
|
|
+using System.Xml.XPath;
|
|
|
|
|
+using Quadarax.Foundation.Core.Console;
|
|
|
|
|
+using Quadarax.Foundation.Core.Logging;
|
|
|
|
|
+using Quadarax.Foundation.Core.QConsole.Handlers;
|
|
|
|
|
+
|
|
|
|
|
+namespace Quadarax.Foundation.Core.QConsole.Configuration
|
|
|
|
|
+{
|
|
|
|
|
+ public class StartupConfiguration
|
|
|
|
|
+ {
|
|
|
|
|
+ #region *** Private Fields ***
|
|
|
|
|
+ private bool _isConsoleDebug;
|
|
|
|
|
+ private string[] _defaultCommands = {"CmdClear", "CmdExit", "CmdPrint", "CmdSelection"};
|
|
|
|
|
+
|
|
|
|
|
+ private readonly IList<string> _disabledCommands = new List<string>();
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region *** Properties ***
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Name of console application, If not defined uses default name from entryAssembly.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string ConsoleName { get; } = string.Empty;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Console application version. If not defined uses version of entryAssembly.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public Version ConsoleVersion { get; } = Version.Parse("0.0.0.0");
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Console application copyright message. If not set skip this info.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string ConsoleCopyright { get; set; } = string.Empty;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Defines if console is initialized from XML definition.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public bool IsInitFromXml { get; }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Left introducing of interactive mode character.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string CharacterLineIntroduce { get; set; } = string.Empty;
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Separator between two ordinal arguments
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string CharacterOrdinalArgumentSeparator { get; set; } = string.Empty;
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Named argument prefix character.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string CharacterNamedArgumentSeparator { get; set; } = string.Empty;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Named argument postfix character {defines end of argument code and value)
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string CharacterNamedArgumentValueSeparator { get; set; } = string.Empty;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Start end end string value character
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string CharacterTextValueBraceSeparator { get; set; } = string.Empty;
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Separator between two selection inputs
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string CharacterSelectionInputValueSeparator { get; set; } = string.Empty;
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Date input/output value format
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string DateFormat { get; set; } = string.Empty;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Time input/output value format
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string TimeFormat { get; set; } = string.Empty;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Defines if interactive mode is enabled
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public bool AllowInteractive { get; set; }
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Defines if initial variables is allowed for interactive mode.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public bool AllowPreset { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Defines assembly list where custom commands are defined (in case explicit command definition).
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public Assembly[] CommandDefinitionAssembly { get; set; } = Array.Empty<Assembly>();
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Returns name of command classes that will be disabled (hidden)
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string[] DisabledCommands => _disabledCommands.ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Defines if waits on key at the end of process in non-interactive mode (inline mode)
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public bool WaitOnKeyInNonInteractiveMode { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Defines if show status of engine and command context before every command executed.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public bool ShowStatusOnEveryCommand { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Defines if throws exception when command execution is not successful.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public bool ThrowExceptionWhenNotSuccess { get; set; } = false;
|
|
|
|
|
+
|
|
|
|
|
+ public bool UseDefaultHandlers { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Handler when no arguments input specified. If not set then do nothing.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public NothingToDo? HandlerNothingToDo { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ public bool IsConsoleDebug {
|
|
|
|
|
+ get
|
|
|
|
|
+ {
|
|
|
|
|
+ return _isConsoleDebug;
|
|
|
|
|
+ }
|
|
|
|
|
+ set
|
|
|
|
|
+ {
|
|
|
|
|
+ _isConsoleDebug = value;
|
|
|
|
|
+ DebugConsoleWriter.IsWriteDebugEnabled = value;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public ILogger? DefaultLoggerFactory { get; set; }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region *** Constructor ***
|
|
|
|
|
+
|
|
|
|
|
+ public StartupConfiguration(string consoleName, Version consoleVersion)
|
|
|
|
|
+ {
|
|
|
|
|
+ ConsoleName = consoleName;
|
|
|
|
|
+ ConsoleVersion = consoleVersion;
|
|
|
|
|
+ IsInitFromXml = false;
|
|
|
|
|
+ InitDefaults();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StartupConfiguration(string consoleXmlFileName)
|
|
|
|
|
+ {
|
|
|
|
|
+ IsInitFromXml = true;
|
|
|
|
|
+ InitDefaults();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StartupConfiguration(XPathNavigator configurationNavigator)
|
|
|
|
|
+ {
|
|
|
|
|
+ IsInitFromXml = true;
|
|
|
|
|
+ InitDefaults();
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region *** Public Operations ***
|
|
|
|
|
+ public StartupConfiguration EnableDebugMode()
|
|
|
|
|
+ {
|
|
|
|
|
+ IsConsoleDebug = true;
|
|
|
|
|
+ return this;
|
|
|
|
|
+ }
|
|
|
|
|
+ public StartupConfiguration DisableDebugMode()
|
|
|
|
|
+ {
|
|
|
|
|
+ IsConsoleDebug = false;
|
|
|
|
|
+ return this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StartupConfiguration DisableDefaultCommands()
|
|
|
|
|
+ {
|
|
|
|
|
+ return DisableCommands(_defaultCommands);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StartupConfiguration EnableDefaultCommands()
|
|
|
|
|
+ {
|
|
|
|
|
+ return EnableCommands(_defaultCommands);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StartupConfiguration EnableCommands(params string[]? commandClassNames)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (commandClassNames == null)
|
|
|
|
|
+ return this;
|
|
|
|
|
+
|
|
|
|
|
+ foreach (var className in commandClassNames)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (_disabledCommands.Contains(className))
|
|
|
|
|
+ _disabledCommands.Remove(className);
|
|
|
|
|
+ }
|
|
|
|
|
+ return this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public StartupConfiguration DisableCommands(params string[]? commandClassNames)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (commandClassNames == null)
|
|
|
|
|
+ return this;
|
|
|
|
|
+ foreach (var className in commandClassNames)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!_disabledCommands.Contains(className))
|
|
|
|
|
+ _disabledCommands.Add(className);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region *** Private Operations ***
|
|
|
|
|
+ private void InitDefaults()
|
|
|
|
|
+ {
|
|
|
|
|
+ CharacterLineIntroduce = Defaults.RoleCharacters.ConsoleLineIntroduce;
|
|
|
|
|
+ CharacterOrdinalArgumentSeparator = Defaults.RoleCharacters.OrdinalArgumentSeparator;
|
|
|
|
|
+ CharacterNamedArgumentSeparator = Defaults.RoleCharacters.NamedArgumentSeparator;
|
|
|
|
|
+ CharacterNamedArgumentValueSeparator = Defaults.RoleCharacters.NamedArgumentValueSeparator;
|
|
|
|
|
+ CharacterTextValueBraceSeparator = Defaults.RoleCharacters.TextValueBraceSeparator;
|
|
|
|
|
+ CharacterSelectionInputValueSeparator = Defaults.RoleCharacters.InputSelectionValueSeparator;
|
|
|
|
|
+
|
|
|
|
|
+ DateFormat = Defaults.Formats.DateFormat;
|
|
|
|
|
+ TimeFormat = Defaults.Formats.TimeFormat;
|
|
|
|
|
+
|
|
|
|
|
+ AllowInteractive = Defaults.Console.InteractiveAllowed;
|
|
|
|
|
+ AllowPreset = Defaults.Console.PresetAllowed;
|
|
|
|
|
+ IsConsoleDebug = Defaults.Console.ConsoleDebugMode;
|
|
|
|
|
+ WaitOnKeyInNonInteractiveMode = Defaults.Console.WaitOnKeyInNonInteractiveMode;
|
|
|
|
|
+ ShowStatusOnEveryCommand = Defaults.Console.ShowStatusOnEveryCommand;
|
|
|
|
|
+ UseDefaultHandlers = Defaults.Console.UseDefaultHadlers;
|
|
|
|
|
+
|
|
|
|
|
+ if (UseDefaultHandlers)
|
|
|
|
|
+ {
|
|
|
|
|
+ HandlerNothingToDo += engine =>
|
|
|
|
|
+ {
|
|
|
|
|
+ using (var writer = new ConsoleWriter(ConsoleColor.Yellow))
|
|
|
|
|
+ {
|
|
|
|
|
+ writer.WriteLine("Nothing to do.");
|
|
|
|
|
+ }
|
|
|
|
|
+ using (var writer = new ConsoleWriter(ConsoleColor.DarkGreen))
|
|
|
|
|
+ {
|
|
|
|
|
+ writer.WriteLine("Put some arguments to do something. For example -help to list commands and arguments.");
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+ }
|
|
|
|
|
+}
|