Ejemplo n.º 1
0
        static void Main()
        {
            /* Delete walletd.log if it exists so we can ensure when reading
             * the file later upon a crash, that we are reporting the proper
             * crash reason and not some previous crash */
            System.IO.File.Delete("walletd1.log");

#if DEBUG
            //Properties.Settings.Default.Reset();
#endif

            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var uPrompt = new UpdatePrompt();
            uPrompt.ShowDialog();

            string _pass   = "";
            string _wallet = "";

            /* Reopen wallet from last time */
            if (Properties.Settings.Default.walletPath != "" && System.IO.File.Exists(Properties.Settings.Default.walletPath))
            {
                var pPrompt = new passwordPrompt();
                var pResult = pPrompt.ShowDialog();
                if (pResult != DialogResult.OK)
                {
                    SelectionPrompt sPrompt = new SelectionPrompt();
                    sPrompt.ShowDialog();
                    if (sPrompt.DialogResult != DialogResult.OK)
                    {
                        return;
                    }
                    else
                    {
                        _pass   = sPrompt.WalletPassword;
                        _wallet = sPrompt.WalletPath;
                    }
                }
                else
                {
                    _pass   = pPrompt.WalletPassword;
                    _wallet = Properties.Settings.Default.walletPath;
                    Utilities.Close(pPrompt);
                }
            }
            else
            {
                SelectionPrompt sPrompt = new SelectionPrompt();
                sPrompt.ShowDialog();
                if (sPrompt.DialogResult != DialogResult.OK)
                {
                    return;
                }
                else
                {
                    _pass   = sPrompt.WalletPassword;
                    _wallet = sPrompt.WalletPath;
                }
            }

jumpBackFlag:
            var splash = new Splash(_wallet, _pass);
            Application.Run(splash);
            if (jumpBack) //Hacky, but will work for now until a proper loop can be placed.
            {
                jumpBack = false;
                goto jumpBackFlag;
            }
        }
Ejemplo n.º 2
0
        static void Main()
        {
#if DEBUG
            Properties.Settings.Default.Reset();
#endif

            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var uPrompt = new updatePrompt();
            uPrompt.ShowDialog();

            string _pass   = "";
            string _wallet = "";
            if (Properties.Settings.Default.walletPath != "" && System.IO.File.Exists(Properties.Settings.Default.walletPath))
            {
                var pPrompt = new passwordPrompt();
                var pResult = pPrompt.ShowDialog();
                if (pResult != DialogResult.OK)
                {
                    SelectionPrompt sPrompt = new SelectionPrompt();
                    sPrompt.ShowDialog();
                    if (sPrompt.DialogResult != DialogResult.OK)
                    {
                        return;
                    }
                    else
                    {
                        _pass   = sPrompt.walletPassword;
                        _wallet = sPrompt.walletPath;
                    }
                }
                else
                {
                    _pass   = pPrompt.walletPassword;
                    _wallet = Properties.Settings.Default.walletPath;
                    pPrompt.Dispose();
                }
            }
            else
            {
                SelectionPrompt sPrompt = new SelectionPrompt();
                sPrompt.ShowDialog();
                if (sPrompt.DialogResult != DialogResult.OK)
                {
                    return;
                }
                else
                {
                    _pass   = sPrompt.walletPassword;
                    _wallet = sPrompt.walletPath;
                }
            }

            //var args = new Dictionary<string, object>() { };
            //var testobj = ConnectionManager.rpcRequest("http://127.0.0.1:8070/json_rpc", "getBalance", args);
            //foreach(var item in testobj)
            //{
            //    Console.Write(item.Key + "-" + item.Value);
            //}


            var splash = new Splash(_wallet, _pass);
            Application.Run(splash);
        }