public MainWindow(SniperPortfolio portfolio, string sniperId) { InitializeComponent(); this.Text = Program.APPLICATION_TITLE; tbItemId.Name = Program.NEW_ITEM_ID_NAME; tbStopPrice.Name = Program.NEW_ITEM_STOP_PRICE_NAME; btnJoin.Name = Program.JOIN_BUTTON_NAME; SniperTableModel tableModel = new SniperTableModel(); portfolio.AddPortfolioListener(tableModel); snipers = tableModel; gvSniper.DataSource = snipers; this.sniperId = sniperId; }
public static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SniperPortfolio portfolio = new SniperPortfolio(); form = new MainWindow(portfolio, args[ARG_USERNAME]); form.TbStopPrice.Text = args[ARG_STOP_PRICE]; XMPPAuctionHouse auctionHouse = XMPPAuctionHouse.Connect(args[ARG_HOSTNAME], args[ARG_PORT], args[ARG_USERNAME], args[ARG_PASSWORD]); form.AddUserRequestListener(new SniperLauncher(auctionHouse, portfolio)); Application.Run(form); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; }