private void BuildTabs() { //0 lendingPage = new LendingPage(); lendingTab = new TabItem(); lendingTab.Header = "Lending"; lendingTab.Background = System.Windows.Media.Brushes.SteelBlue; TabMain.Items.Add(lendingTab); //1 exchangeBTCPage = new ExchangePage("BTC"); exchangeBTCTab = new TabItem(); exchangeBTCTab.Header = "Exchange BTC"; exchangeBTCTab.Background = System.Windows.Media.Brushes.LightSteelBlue; TabMain.Items.Add(exchangeBTCTab); //2 exchangeETHPage = new ExchangePage("ETH"); exchangeETHTab = new TabItem(); exchangeETHTab.Header = "Exchange ETH"; exchangeETHTab.Background = System.Windows.Media.Brushes.Yellow; TabMain.Items.Add(exchangeETHTab); //3 exchangeXMRPage = new ExchangePage("XMR"); exchangeXMRTab = new TabItem(); exchangeXMRTab.Header = "Exchange XMR"; exchangeXMRTab.Background = System.Windows.Media.Brushes.IndianRed; TabMain.Items.Add(exchangeXMRTab); //4 exchangeUSDTPage = new ExchangePage("USDT"); exchangeUSDTTab = new TabItem(); exchangeUSDTTab.Header = "Exchange USDT"; exchangeUSDTTab.Background = System.Windows.Media.Brushes.LightGoldenrodYellow; TabMain.Items.Add(exchangeUSDTTab); //4 accountPage = new AccountPage(); accountTab = new TabItem(); accountTab.Header = "Account"; accountTab.Background = System.Windows.Media.Brushes.GreenYellow; TabMain.Items.Add(accountTab); //4 botTrader = new BotTrader(); botTab = new TabItem(); botTab.Header = "Bot Trader"; botTab.Background = System.Windows.Media.Brushes.Salmon; TabMain.Items.Add(botTab); }
void Dispose(bool disposing) { try { if (!disposedValue) { if (disposing) { if (PoloniexClient != null) { if (PoloniexClient.Live != null) { PoloniexClient.Live.Stop(); } } if (updateTimer != null) { updateTimer.Dispose(); } updateTimer = null; if (semaphoreSlim != null) { semaphoreSlim.Dispose(); } semaphoreSlim = null; if (lendingPage != null) { lendingPage.Dispose(); } lendingPage = null; if (exchangeBTCPage != null) { exchangeBTCPage.Dispose(); } exchangeBTCPage = null; if (exchangeXMRPage != null) { exchangeXMRPage.Dispose(); } exchangeXMRPage = null; if (exchangeUSDTPage != null) { exchangeUSDTPage.Dispose(); } exchangeUSDTPage = null; if (accountPage != null) { accountPage.Dispose(); } accountPage = null; if (TabMain != null) { if (TabMain.Items != null) { TabMain.Items.Clear(); } } LoanContext.Instance().Dispose(); if (FachadaWSSGS != null) { FachadaWSSGS.Close(); } } } } finally { MarketService.Instance().MarketList = null; WalletService.Instance().WalletList = null; TabMain = null; exchangeBTCTab = null; exchangeXMRTab = null; exchangeUSDTTab = null; accountTab = null; lendingTab = null; FachadaWSSGS = null; disposedValue = true; } }