public static TransactionMain getInstance(MainWindow mainWindow) { if (instance == null) { instance = new TransactionMain(mainWindow); } return(instance); }
public static TransactionMain getInstance(MainWindow mainWindow, List <Transaction> attributes, string accountnumber) { if (instance == null) { instance = new TransactionMain(mainWindow, attributes, accountnumber); } return(instance); }
public void Execute(object parameter) { mainWindow.tableDock.Background = new SolidColorBrush(Color.FromRgb(217, 133, 59)); mainWindow.importDock.Background = new SolidColorBrush(Color.FromRgb(217, 133, 59)); mainWindow.stockChartDock.Background = new SolidColorBrush(Color.FromRgb(217, 133, 59)); mainWindow.tableMenuTop.Visibility = System.Windows.Visibility.Hidden; mainWindow.importMenuTop.Visibility = System.Windows.Visibility.Hidden; mainWindow.portfolioMenuTop.Visibility = System.Windows.Visibility.Hidden; if (buttonContent.Equals("Import")) { mainWindow.MainFrame.Content = ImportMainPage.getInstance(mainWindow); mainWindow.importMenuTop.Visibility = System.Windows.Visibility.Visible; mainWindow.importDock.Background = new SolidColorBrush(Color.FromRgb(198, 61, 15)); } else if (buttonContent.Equals("Database")) { mainWindow.MainFrame.Content = TransactionMain.getInstance(mainWindow, mainWindow.getTableAttributes(), mainWindow.getAccounNumber()); mainWindow.tableMenuTop.Visibility = System.Windows.Visibility.Visible; mainWindow.tableDock.Background = new SolidColorBrush(Color.FromRgb(198, 61, 15)); } else if (buttonContent.Equals("stockMarketData")) { if (mainWindow.webStockStopwatch.Elapsed == TimeSpan.FromMilliseconds(0)) { mainWindow.webStockStopwatch.Start(); StockChart stockChart = new StockChart(); //stockChart.getNewStockData(); //stockChart.refreshChartAttributes(); mainWindow.MainFrame.Content = stockChart; mainWindow.portfolioMenuTop.Visibility = System.Windows.Visibility.Visible; mainWindow.stockChartDock.Background = new SolidColorBrush(Color.FromRgb(198, 61, 15)); } else { if (mainWindow.webStockStopwatch.Elapsed <= TimeSpan.FromMinutes(1.5)) { MessageBox.Show("Please wait for " + (TimeSpan.FromMinutes(1.5) - mainWindow.webStockStopwatch.Elapsed) + " seconds!"); } else { mainWindow.webStockStopwatch.Stop(); mainWindow.webStockStopwatch.Reset(); } } } else if (buttonContent.Equals("Exit")) { mainWindow.Close(); } }