/// <summary>
 /// Init singleton console. You can access it through CmdLineExtension.Inst .
 /// </summary>
 /// <param name="consoleHandler">If null, will use default handler.</param>
 public static void Init(IConsoleHandler consoleHandler = null)
 {
     if (_inst != null)
     {
         throw new Exception("Console was inited before.");
     }
     _inst = new CmdLineExtension(
         consoleHandler ?? new DefaultConsoleHandler()
         );
 }
 public CommandLineBase(CmdLineExtension cmdLineExtension = null)
 {
     Cmd            = cmdLineExtension ?? CmdLineExtension.Inst;
     CmdNameAndInfo = CreateReflectionDict();
 }
Ejemplo n.º 3
0
 public CommandLineBase(ICmdSwitcher cmdSwitcher, CmdLineExtension cmdLineExtension = null)
 {
     Cmd = cmdLineExtension ?? CmdLineExtension.Inst;
     CurrentCmdSwitcher = cmdSwitcher;
     CmdNameAndMethod   = CreateReflectionDict();
 }