Пример #1
0
 private void toolStripButton_zero_Click(object sender, EventArgs e)
 {
     PreferenceManager.preferences.HideZeroBalances = !PreferenceManager.preferences.HideZeroBalances;
     PreferenceManager.UpdatePreferenceFile();
     updateZeroButton();
     UpdateUI();
 }
Пример #2
0
        private void listView_Wallets_CellEditFinishing(object sender, CellEditEventArgs e)
        {
            WalletBalance balance = listView_Wallets.SelectedObject as WalletBalance;

            if (balance != null)
            {
                WalletBalance listItem = PreferenceManager.WalletPreferences.WalletForks.FirstOrDefault(item => item.Symbol == balance.Symbol && item.Name == balance.Name);
                if (listItem != null)
                {
                    try
                    {
                        Decimal newValue = Convert.ToDecimal(e.Control.Text);
                        //LogManager.AddLogMessage(Name, "listView_Wallets_CellEditFinishing", balance.Symbol + " | " + e.Control.Text + " | " + e.Value, LogManager.LogMessageType.DEBUG);
                        listItem.Balance = newValue;
                        PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Wallet);
                        LoadWallets();
                    }
                    catch (Exception ex)
                    {
                        LogManager.AddLogMessage(Name, "listView_Wallets_CellEditFinishing", ex.Message, LogManager.LogMessageType.EXCEPTION);
                    }
                }
            }
            //LogManager.AddLogMessage(Name, "listView_Wallets_CellEditFinishing", sender + " | " + e.Control.Text + " | " + e.Value, LogManager.LogMessageType.DEBUG);
        }
Пример #3
0
        private void toolStripButton_save_Click(object sender, EventArgs e)
        {
            foreach (Fork fork in forks)
            {
                WalletBalance listItem = PreferenceManager.WalletPreferences.WalletForks.FirstOrDefault(item => item.Name == wallet.Name && item.Symbol == fork.ticker.ToUpper());

                if (listItem == null)
                {
                    //fork.id = wallet.Name;

                    Decimal             balance = Decimal.Parse(fork.balance.expected.ToString(), System.Globalization.NumberStyles.Float) / 100000000;
                    CoinMarketCapTicker ticker  = PreferenceManager.CoinMarketCapPreferences.Tickers.FirstOrDefault(item => item.symbol == fork.ticker.ToUpper() && item.name == fork.name);
                    //decimal btcTotal = 0;
                    //decimal usdTotal = 0;

                    if (ticker != null)
                    {
                        fork.TotalInBTC = balance * ticker.price_btc;
                        fork.TotalInUSD = balance * ticker.price_usd;
                    }

                    WalletBalance newBalance = new WalletBalance()
                    {
                        Address       = fork.addr,
                        Balance       = balance,
                        CoinName      = fork.name,
                        IsForkBalance = true,
                        Name          = wallet.Name,
                        Symbol        = fork.ticker.ToUpper(),
                        TotalInBTC    = fork.TotalInBTC,
                        TotalInUSD    = fork.TotalInUSD,
                        WalletName    = wallet.WalletName,
                        Verified      = true
                    };
                    PreferenceManager.WalletPreferences.WalletForks.Add(newBalance);
                }
                else
                {
                    Decimal             balance = Decimal.Parse(fork.balance.expected.ToString(), System.Globalization.NumberStyles.Float) / 100000000;
                    CoinMarketCapTicker ticker  = PreferenceManager.CoinMarketCapPreferences.Tickers.FirstOrDefault(item => item.symbol == fork.ticker.ToUpper() && item.name == fork.name);

                    if (ticker != null)
                    {
                        listItem.Address    = fork.addr;
                        listItem.Verified   = true;
                        listItem.Balance    = balance;
                        listItem.TotalInBTC = balance * ticker.price_btc;
                        listItem.TotalInUSD = balance * ticker.price_usd;
                    }
                }

                PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Wallet);
                FormManager.UpdateBalanceManager(true);
                //FormManager.UpdateWalletManager();
                if (ParentForm != null)
                {
                    ParentForm.Close();
                }
            }
        }
Пример #4
0
 private void toolStripDropDownButton_period_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     toolStripDropDownButton_period.Text = e.ClickedItem.Text;
     CryptoCompare.CryptoCompareChartPeriod type = (CryptoCompare.CryptoCompareChartPeriod)Enum.Parse(typeof(CryptoCompare.CryptoCompareChartPeriod), e.ClickedItem.Tag.ToString());
     PreferenceManager.CryptoComparePreferences.PeriodType = type;
     PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.CryptoCompare);
     UpdateUI();
 }
Пример #5
0
 private void toolStripDropDownButton_FeedSource_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     toolStripDropDownButton_FeedSource.Text = e.ClickedItem.Tag.ToString();
     CryptoCompare.CryptoCompareFeedType type = (CryptoCompare.CryptoCompareFeedType)Enum.Parse(typeof(CryptoCompare.CryptoCompareFeedType), e.ClickedItem.Text);
     PreferenceManager.CryptoComparePreferences.feedType = type;
     PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.CryptoCompare);
     UpdateUI();
 }
Пример #6
0
 private void toolStripDropDownButton_market_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     toolStripDropDownButton_market.Text           = e.ClickedItem.Text;
     PreferenceManager.ArbitragePreferences.market = e.ClickedItem.Text;
     PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Arbitrage);
     toolStripDropDownButton_market.Image = e.ClickedItem.Image;
     SetWatchlist();
 }
Пример #7
0
 private void button_save_Click(object sender, EventArgs e)
 {
     PreferenceManager.preferences.DBSource   = textBox_DBSource.Text;
     PreferenceManager.preferences.DBName     = textBox_DBName.Text;
     PreferenceManager.preferences.DBID       = textBox_DBID.Text;
     PreferenceManager.preferences.DBPassword = textBox_DBPassword.Text;
     PreferenceManager.UpdatePreferenceFile();
 }
Пример #8
0
        private void marketButton_Click(object sender, EventArgs e)
        {
            ToolStripRadioButton item = (ToolStripRadioButton)sender;

            Exchange.CurrentMarket = item.Text;
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Exchange);
            //LogManager.AddLogMessage(Name, "marketButton_Click", "marketClicked=" + marketClicked);
            UpdateUI(true);
        }
Пример #9
0
        private void toolStripRadioButton_view_Click(object sender, EventArgs e)
        {
            ToolStripRadioButton button = sender as ToolStripRadioButton;
            string view = button.Tag.ToString();

            PreferenceManager.preferences.BalanceView = (BalanceViewType)Enum.Parse(typeof(BalanceViewType), view);
            PreferenceManager.UpdatePreferenceFile();
            UpdateUI(true);
        }
Пример #10
0
        private void toolStripDropDownButton_widget_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            string widgetName = e.ClickedItem.Tag.ToString();

            toolStripDropDownButton_widget.Text = widgetName;
            PreferenceManager.CryptoComparePreferences.WidgetType = (CryptoCompare.CryptoCompareWidgetType)Enum.Parse(typeof(CryptoCompare.CryptoCompareWidgetType), widgetName);
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.CryptoCompare);
            ChangeWidget(PreferenceManager.CryptoComparePreferences.WidgetType);
        }
Пример #11
0
 private void toolStripDropDownButton_style_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     //LogManager.AddLogMessage(Name, "toolStripDropDownButton_style_DropDownItemClicked", e.ClickedItem.Text + " | " + e.ClickedItem.Tag, LogManager.LogMessageType.DEBUG);
     toolStripDropDownButton_style.Text = e.ClickedItem.Text;
     UpdateOptionsMenu();
     PreferenceManager.TradingViewPreferences.AdvancedChartParameters.style = (TradingViewChartStyle)Enum.Parse(typeof(TradingViewChartStyle), e.ClickedItem.Text);
     PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
     SetFullView();
 }
Пример #12
0
        private void toolStripDropDownButton_exchange_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            toolStripDropDownButton_exchange.Image = e.ClickedItem.Image;
            toolStripDropDownButton_exchange.Text  = e.ClickedItem.Text.ToUpper();

            PreferenceManager.TradingViewPreferences.AdvancedChartParameters.exchange = (TradingViewCryptoExchange)System.Enum.Parse(typeof(TradingViewCryptoExchange), e.ClickedItem.Text, true);
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
            SetFullView();
        }
Пример #13
0
 private void toolStripTextBox_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         PreferenceManager.CryptoComparePreferences.Symbol = toolStripTextBox_symbol.Text.ToUpper();
         PreferenceManager.CryptoComparePreferences.Market = toolStripTextBox_market.Text.ToUpper();
         PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.CryptoCompare);
         UpdateUI();
     }
 }
Пример #14
0
        private void toolStripDropDownButton_view_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            LogManager.AddLogMessage(Name, "toolStripDropDownButton_view_DropDownItemClicked", sender.ToString() + " | " + e.ClickedItem.Tag, LogManager.LogMessageType.DEBUG);
            toolStripDropDownButton_view.Text = e.ClickedItem.Tag.ToString();
            TradingViewCryptocurrencyMarketDefaultColumn view = (TradingViewCryptocurrencyMarketDefaultColumn)Enum.Parse(typeof(TradingViewCryptocurrencyMarketDefaultColumn), e.ClickedItem.Tag.ToString());

            PreferenceManager.TradingViewPreferences.CryptocurrencyMarketParameters.defaultColumn = view;
            marketsWidget.setCryptocurrencyMarket(PreferenceManager.TradingViewPreferences.CryptocurrencyMarketParameters);
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
        }
Пример #15
0
        private void WatchlistItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = sender as ToolStripMenuItem;

            //LogManager.AddLogMessage(Name, "WatchlistItem_Click", item.Text, LogManager.LogMessageType.DEBUG);
            toolStripDropDownButton_watchlists.Text = item.Text;
            PreferenceManager.TradingViewPreferences.CurrentWatchList = item.Text;
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
            UpdateOverviews();
        }
Пример #16
0
        private void toolStripDropDownButton_currency_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            //LogManager.AddLogMessage(Name, "toolStripDropDownButton_currency_DropDownItemClicked", sender.ToString() + " | " + e.ClickedItem.Text, LogManager.LogMessageType.DEBUG);
            toolStripDropDownButton_currency.Text = e.ClickedItem.Text;
            TradingViewCryptocurrencyMarketDisplayCurrency type = (TradingViewCryptocurrencyMarketDisplayCurrency)Enum.Parse(typeof(TradingViewCryptocurrencyMarketDisplayCurrency), e.ClickedItem.Text);

            PreferenceManager.TradingViewPreferences.CryptocurrencyMarketParameters.displayCurrency = type;
            marketsWidget.setCryptocurrencyMarket(PreferenceManager.TradingViewPreferences.CryptocurrencyMarketParameters);
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
        }
Пример #17
0
 private void listView_ItemActivate(object sender, EventArgs e)
 {
     if (listView.SelectedObject != null)
     {
         CryptoCompare.CryptoCompareCoin coin = listView.SelectedObject as CryptoCompare.CryptoCompareCoin;
         //LogManager.AddLogMessage(Name, "listView_ItemActivate", coin.Symbol, LogManager.LogMessageType.DEBUG);
         PreferenceManager.CryptoComparePreferences.Symbol = coin.Symbol;
         PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.CryptoCompare);
         toolStripTextBox_symbol.Text = coin.Symbol;
         UpdateUI();
     }
 }
Пример #18
0
 private void toolStripDropDownButton_period_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     toolStripDropDownButton_period.Text = e.ClickedItem.Text;
     CryptoCompare.CryptoCompareChartPeriod type = (CryptoCompare.CryptoCompareChartPeriod)Enum.Parse(typeof(CryptoCompare.CryptoCompareChartPeriod), e.ClickedItem.Tag.ToString());
     PreferenceManager.ArbitragePreferences.ChartPeriod = type;
     PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Arbitrage);
     //PreferenceManager.CryptoComparePreferences.PeriodType = type;
     //PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.CryptoCompare);
     //UpdateUI();
     //flowLayoutPanel.Controls.Clear();
     SetWatchlist();
 }
Пример #19
0
        private void toolStripNumberControl_maxItems_ValueChanged(object sender, EventArgs e)
        {
            NumericUpDown num   = toolStripNumberControl_maxItems.NumericUpDownControl as NumericUpDown;
            int           value = Convert.ToInt32(num.Value);

            if (PreferenceManager.ArbitragePreferences.maxListCount != value)
            {
                LogManager.AddLogMessage(Name, "toolStripNumberControl_maxItems_ValueChanged", "sender=" + sender + " | " + e.GetType() + " | " + e.GetHashCode() + " | " + value, LogManager.LogMessageType.DEBUG);
                PreferenceManager.ArbitragePreferences.maxListCount = Convert.ToInt32(num.Value);
                PreferenceManager.UpdatePreferenceFile();
                UpdateUI(true);
            }
        }
Пример #20
0
        private void toolStripDropDownButton_menu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.GetType() == typeof(ToolStripMenuItem))
            {
                ToolStripMenuItem menuItem = e.ClickedItem as ToolStripMenuItem;
                toolStripDropDownButton_menu.HideDropDown();
                //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
                    };
                    DialogResult result = dialog.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        if (PreferenceManager.SetFormFont(ParentForm, dialog.Font))
                        {
                            UpdateUI(true);
                        }
                    }
                    //UpdateUI(true);
                    break;

                case "FontIncrease":
                    if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size + 1, ParentForm.Font.Style)))
                    {
                        UpdateUI(true);
                    }
                    break;

                case "FontDecrease":
                    if (PreferenceManager.SetFormFont(ParentForm, new Font(ParentForm.Font.FontFamily, ParentForm.Font.Size - 1, ParentForm.Font.Style)))
                    {
                        UpdateUI(true);
                    }
                    break;

                case "ClearData":
                    PreferenceManager.WalletPreferences.WalletForks.Clear();
                    PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Wallet);
                    UpdateUI();
                    break;

                default:
                    // NOTHING
                    break;
                }
            }
        }
Пример #21
0
        private void toolStripButton_toggleHeight_Click(object sender, EventArgs e)
        {
            /*
             * EarnGGAccount account = PreferenceManager.EarnGGPreferences.EarnGGAccounts.Find(item => item.email == "*****@*****.**");
             *
             * if (account != null)
             * {
             *  LogManager.AddLogMessage(Name, "toolStripButton_toggleHeight_Click", account.email + " | ", LogManager.LogMessageType.DEBUG);
             * }
             */

            PreferenceManager.EarnGGPreferences.collapsed = !PreferenceManager.EarnGGPreferences.collapsed;
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.EarnGG);
            toggleView();
        }
Пример #22
0
        private void TradingViewManagerControl_SizeChanged(object sender, EventArgs e)
        {
            //LogManager.AddLogMessage(Name, "TradingViewManagerControl_SizeChanged", tabControl.ClientSize.Width + " | " + tabControl.ClientSize.Height, LogManager.LogMessageType.DEBUG);
            int pageWidth  = tabControl.ClientSize.Width - 50;
            int pageHeight = tabControl.ClientSize.Height - 50;

            pageSize = new Size(pageWidth, pageHeight);
            //LogManager.AddLogMessage(Name, "TradingViewManagerControl_SizeChanged", pageSize.Width + " | " + pageSize.Height, LogManager.LogMessageType.DEBUG);
            //PreferenceManager.TradingViewPreferences.SymbolOverviewParameters = new TradingViewSymbolOverviewParameters();
            PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.width  = pageSize.Width;
            PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.height = pageSize.Height;
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
            //LogManager.AddLogMessage(Name, "TradingViewManagerControl_Resize", pageSize.Width + " | " + pageSize.Height, LogManager.LogMessageType.DEBUG);
            overviewsWidget.setSymbolOverview(PreferenceManager.TradingViewPreferences.SymbolOverviewParameters);
        }
Пример #23
0
        public static void updateTickers()
        {
            //LogManager.AddLogMessage(Name, "updateTickers", "UPDATING", LogManager.LogMessageType.OTHER);
            List <CoinMarketCapTicker> tickers = getTickerList(0, 5000);

            if (tickers.Count > 0)
            {
                //PreferenceManager.CoinMarketCapPreferences.Tickers = new BlockingCollection<CoinMarketCapTicker>(new ConcurrentQueue<CoinMarketCapTicker>(getTickerList(0, 5000)));
                PreferenceManager.CoinMarketCapPreferences.Tickers = getTickerList(0, 5000);
                PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.CoinMarketCap);
                FormManager.UpdateCoinMarketCap();
                //PreferenceManager.preferences.CoinMarketCapTickers = tickers;
                //PreferenceManager.UpdatePreferencesFile();
            }
        }
Пример #24
0
 private void button_save_Click(object sender, EventArgs e)
 {
     //account.api
     if (account.api.key.Length > 0 && account.api.secret.Length > 0)
     {
         EarnGG.EarnGGAccount listItem = PreferenceManager.EarnGGPreferences.EarnGGAccounts.FirstOrDefault(item => item.api.key == account.api.key && item.api.secret == account.api.secret);
         if (listItem == null)
         {
             PreferenceManager.EarnGGPreferences.EarnGGAccounts.Add(account);
             //PreferenceManager.UpdatePreferenceSnapshots();
             PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.EarnGG);
             EarnGG.UpdateUI();
             ParentForm.Close();
         }
     }
 }
Пример #25
0
        private void toolStripButton_refresh_Click(object sender, EventArgs e)
        {
            PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol = toolStripTextBox_symbol.Text.ToUpper();
            PreferenceManager.TradingViewPreferences.AdvancedChartParameters.market = toolStripTextBox_market.Text.ToUpper();
            if (PreferenceManager.TradingViewPreferences.AdvancedChartParameters.market.Contains("USD"))
            {
                ExchangeManager.Exchange listItem = exchanges.FirstOrDefault(i => i.TradingView == PreferenceManager.TradingViewPreferences.AdvancedChartParameters.exchange.ToString());

                if (listItem != null)
                {
                    PreferenceManager.TradingViewPreferences.AdvancedChartParameters.market = listItem.USDSymbol;
                }
            }
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
            SetFullView();
        }
Пример #26
0
        private void VerifyItem_Menu_Click(object sender, EventArgs e)
        {
            string data = sender.ToString().Replace("Verify ", "");

            if (listView_Wallets.SelectedObject != null)
            {
                WalletBalance balance = listView_Wallets.SelectedObject as WalletBalance;
                //balance.Verified = true;
                WalletBalance listItem = PreferenceManager.WalletPreferences.WalletForks.FirstOrDefault(item => item.Symbol == balance.Symbol && item.Name == balance.Name);

                if (listItem != null)
                {
                    listItem.Verified = true;
                    PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Wallet);
                    LoadWallets();
                }
            }
        }
Пример #27
0
        private void SetFullView()
        {
            tabPage_full.Controls.Clear();
            TradingViewWidgetControl widget = new TradingViewWidgetControl()
            {
                Dock = DockStyle.Fill
            };

            toolStripRadioButton_full.Image = ContentManager.GetSymbolIcon(PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol);
            toolStripRadioButton_full.Text  = PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol.ToUpper();
            PreferenceManager.TradingViewPreferences.AdvancedChartParameters.WatchList = GetWatchListBySymbol(PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol);
            PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
            widget.setAdvancedChart(PreferenceManager.TradingViewPreferences.AdvancedChartParameters);
            tabPage_full.Controls.Add(widget);
            //LogManager.AddLogMessage(Name, "SetFullView", Size.Width + " | " + Size.Height + " || " + tabControl.Width + " | " + tabControl.Height + " || " + widget.Width + " | " + widget.Height + " || " + ParentForm.Width + " | " + ParentForm.Height + " || " + ParentForm.ClientSize.Width + " | " + ParentForm.ClientSize.Height, LogManager.LogMessageType.DEBUG);
            SetBTCView();
            SetUSDView();
        }
Пример #28
0
        private void RemoveSymbolItem_Menu_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;

            if (listView_lists.SelectedObject != null)
            {
                TradingViewSymbolList     watchlistItem = listView_lists.SelectedObject as TradingViewSymbolList;
                TradingViewSymbolOverview listItem      = watchlistItem.Items.FirstOrDefault(item => item.tabName == menuItem.Tag.ToString());
                if (listItem != null)
                {
                    DialogResult result = MessageBox.Show("Remove " + listItem.tabName + "?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (result == DialogResult.Yes)
                    {
                        //PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.Remove(listItem);
                        watchlistItem.Items.Remove(listItem);
                        PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
                        listView_symbols.SetObjects(watchlistItem.Items);
                        updateOverviews();
                        //UpdateUI();

                        /*
                         * PreferenceManager.TradingViewPreferences.WatchLists.Remove(listItem);
                         * PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
                         * listView_symbols.Clear();
                         * updateOverviews();
                         * UpdateUI();
                         */
                    }
                }
            }
            //LogManager.AddLogMessage(Name, "RemoveItem_Menu_Click", "Removing " + sender.ToString() + " From List" + " | " + menuItem.Tag.ToString(), LogManager.LogMessageType.DEBUG);
            //TradingViewSymbolOverview listItem = PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.FirstOrDefault(item => item.tabName == menuItem.Tag.ToString());
            //TradingViewSymbolOverview listItem = PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.FirstOrDefault(item => item.tabName == menuItem.Tag.ToString());

            /*
             * if (listItem != null)
             * {
             *  PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.Remove(listItem);
             *  PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
             *  updateOverviews();
             *  UpdateUI();
             * }
             */
        }
Пример #29
0
        private void RemoveItem_Menu_Click(object sender, EventArgs e)
        {
            string data = sender.ToString().Replace("Remove ", "");

            string[] split   = data.Split('_');
            string   name    = split[0];
            string   symbol  = split[1];
            string   address = split[2];
            //LogManager.AddLogMessage(Name, "RemoveItem_Menu_Click", "Removing " + symbol + " From Symbol List", LogManager.LogMessageType.DEBUG);
            WalletBalance wallet = PreferenceManager.WalletPreferences.Wallets.FirstOrDefault(item => item.Name == name && item.Symbol == symbol && item.Address == address);

            if (wallet != null)
            {
                PreferenceManager.WalletPreferences.Wallets.Remove(wallet);
                PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.Wallet);
                FormManager.UpdateBalanceManager();
                UpdateUI();
            }
        }
Пример #30
0
 private void toolStripButton_addList_Click(object sender, EventArgs e)
 {
     if (toolStripTextBox_listName.Text.Length > 0)
     {
         TradingViewSymbolList listItem = PreferenceManager.TradingViewPreferences.WatchLists.FirstOrDefault(item => item.Name == toolStripTextBox_listName.Text);
         if (listItem == null)
         {
             TradingViewSymbolList list = new TradingViewSymbolList()
             {
                 Name = toolStripTextBox_listName.Text
             };
             toolStripTextBox_listName.Text = String.Empty;
             PreferenceManager.TradingViewPreferences.WatchLists.Add(list);
             PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView);
             tradingViewManagerControl.UpdateWatchlists();
             UpdateUI();
         }
     }
 }