Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            StorageHardDrive.InitDependencies(
                new JsonLocalStorage(
                    "values_storage"
                    )
                );
            CmdLineExtension.Init();
            var switcher = new DefaultConsoleSwitcher();

            switcher.RunDefault(new MainCmd(switcher));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var appDir           = Assembly.GetExecutingAssembly().Location;
            var assemblyFileName = Path.GetFileName(appDir);

            appDir = appDir.Remove(appDir.Length - assemblyFileName.Length);
            StorageHardDrive.InitDependencies(
                new JsonLocalStorage(
                    Path.Combine(appDir, "storage.json")
                    )
                );

            //Простейшая консоль с командами из методов классса.
            CmdLineExtension.Init(new DefaultConsoleHandler());
            var cmds = new CmdSwitcher();

            cmds.PushCmdInStack(new CmdLineFacade());
            cmds.ExecuteStartup(args);
            cmds.RunDefault();
        }
Ejemplo n.º 3
0
 public MainCmd(ICmdSwitcher cmdSwitcher, CmdLineExtension cmdLineExtension = null) : base(cmdSwitcher, cmdLineExtension)
 {
     SettingsProp = StorageHardDrive.Get <Settings>("all_settings").Result ?? new Settings();
 }
 public TestCmdLine(CmdLineExtension cmdLineExtension = null) : base(cmdLineExtension)
 {
 }
Ejemplo n.º 5
0
 public CmdLineFacade(CmdLineExtension cmdLineExtension = null) : base(cmdLineExtension)
 {
 }