Esempio n. 1
0
        private void listView_ItemActivate(object sender, EventArgs e)
        {
            WalletBalance wallet = listView.SelectedObject as WalletBalance;

            Form form = new Form()
            {
                Text          = "Wallet Editor",
                StartPosition = FormStartPosition.CenterScreen,
                Font          = ParentForm.Font
            };

            WalletEditorControl control = new WalletEditorControl()
            {
                Dock = DockStyle.Fill
            };

            form.Controls.Add(control);
            control.UpdateData(wallet);
            PreferenceManager.SetControlTheme(control, PreferenceManager.preferences.Theme, form);
            form.Show();
        }
Esempio n. 2
0
        private void toolStripDropDownButton_menu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.GetType() == typeof(ToolStripMenuItem))
            {
                ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem;
                //LogManager.AddLogMessage(Name, "toolStripDropDownButton_menu_DropDownItemClicked", menuItem.Tag.ToString() + " | " + menuItem.Text, LogManager.LogMessageType.DEBUG);
                switch (menuItem.Tag.ToString())
                {
                case "Font":
                    FontDialog dialog = new FontDialog()
                    {
                        Font = ParentForm.Font
                    };
                    //fontDialog.Font = ParentForm.Font;
                    DialogResult result = dialog.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        ParentForm.Font = dialog.Font;
                    }
                    UpdateUI(true);
                    break;

                case "FontIncrease":
                    ParentForm.Font = new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style);
                    UpdateUI(true);
                    break;

                case "FontDecrease":
                    ParentForm.Font = new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style);
                    UpdateUI(true);
                    break;

                case "AddWallet":
                    Form form = new Form()
                    {
                        Text          = "Wallet Editor",
                        StartPosition = FormStartPosition.CenterScreen,
                        Font          = ParentForm.Font
                    };

                    WalletEditorControl control = new WalletEditorControl()
                    {
                        Dock = DockStyle.Fill
                    };

                    form.Controls.Add(control);
                    form.Show();
                    break;

                case "UpdateWallets":


                    if (WalletManager.UpdateWallets())
                    {
                        //UpdateUI();
                    }

                    /*
                     * var client = new RestClient("http://public.coindaddy.io");
                     * var request = new RestRequest(Method.POST);
                     * request.AddHeader("cache-control", "no-cache");
                     * //request.AddHeader("authorization", "Basic cnBjOjEyMzQ=");
                     * request.AddHeader("authorization", "Basic user=rpc&PASSWORD="******"content-type", "application/json");
                     * request.AddParameter("application/json", "{\r\n  \"method\": \"get_running_info\",\r\n  \"params\": {},\r\n  \"jsonrpc\": \"2.0\",\r\n  \"id\": 1\r\n}", ParameterType.RequestBody);
                     * IRestResponse response = client.Execute(request);
                     */
                    break;

                default:
                    // NOTHING
                    break;
                }
            }
        }