Exemple #1
0
 private static void Help(WalletBackend wallet)
 {
     if (wallet.isViewWallet)
     {
         Menu.PrintCommands(DefaultCommands.BasicViewWalletCommands());
     }
     else
     {
         Menu.PrintCommands(DefaultCommands.BasicCommands());
     }
 }
Exemple #2
0
        public static void MainLoop(WalletBackend wallet)
        {
            /* Show the available commands */
            if (wallet.isViewWallet)
            {
                PrintCommands(DefaultCommands.BasicViewWalletCommands());
            }
            else
            {
                PrintCommands(DefaultCommands.BasicCommands());
            }

            while (true)
            {
                string command;

                if (wallet.isViewWallet)
                {
                    command = ParseCommand(
                        DefaultCommands.BasicViewWalletCommands(),
                        DefaultCommands.AllViewWalletCommands(),
                        GetPrompt(wallet)
                        );
                }
                else
                {
                    command = ParseCommand(
                        DefaultCommands.BasicCommands(),
                        DefaultCommands.AllCommands(),
                        GetPrompt(wallet)
                        );
                }

                /* If exit command is given, quit */
                if (CommandImplementations.HandleCommand(command, wallet))
                {
                    return;
                }
            }
        }
Exemple #3
0
        private static void Advanced(WalletBackend wallet)
        {
            if (wallet.isViewWallet)
            {
                Menu.PrintCommands(
                    DefaultCommands.AdvancedViewWalletCommands(),

                    /* The offset to print the number from, e.g. help is
                     * command numbers 1-7 or whatever, advanced is command
                     * numbers 8-19 */
                    DefaultCommands.BasicViewWalletCommands().Count()
                    );
            }
            else
            {
                Menu.PrintCommands(
                    DefaultCommands.AdvancedCommands(),
                    /* Offset */
                    DefaultCommands.BasicCommands().Count()
                    );
            }
        }