private void Window_Loaded(object sender, RoutedEventArgs e) { InfoShowTimer = new Timer(ShowBoxCheck, null, 0, 2 * 1000); InfoShowTimer.Change(-1, 0); dlg = new InfoShow(); total.Text = "100000.00"; now.Text = "5000.00"; total.IsEnabled = false; //now.IsEnabled = false; StockStateBox box1 = new StockStateBox(); box1.Margin = new Thickness(5, 5, 0, 0); box1.StockName.Text = "工商\r\n银行"; box1.UEvent += new EventHandler(uEvent); StockCanvas.Children.Add(box1); StockStateBox box2 = new StockStateBox(); box2.Margin = new Thickness(5, 10 + box1.Margin.Top + box1.Height, 0, 0); box2.StockName.Text = "伊利\r\n股份"; box2.UEvent += new EventHandler(uEvent); StockCanvas.Children.Add(box2); StockStateBox box3 = new StockStateBox(); box3.Margin = new Thickness(5, 10 + box2.Margin.Top + box2.Height, 0, 0); box3.StockName.Text = "工商\r\n银行"; box3.UEvent += new EventHandler(uEvent); StockCanvas.Children.Add(box3); StockStateBox box4 = new StockStateBox(); box4.Margin = new Thickness(5, 10 + box3.Margin.Top + box3.Height, 0, 0); box4.StockName.Text = "北京\r\n银行"; box4.UEvent += new EventHandler(uEvent); StockCanvas.Children.Add(box4); StockStateBox box5 = new StockStateBox(); box5.Margin = new Thickness(5, 10 + box4.Margin.Top + box4.Height, 0, 0); box5.StockName.Text = "以岭\r\n药业"; box5.UEvent += new EventHandler(uEvent); StockCanvas.Children.Add(box5); StockStateBox box6 = new StockStateBox(); box6.Margin = new Thickness(5, 10 + box5.Margin.Top + box5.Height, 0, 0); box6.StockName.Text = "上海\r\n家化"; box6.UEvent += new EventHandler(uEvent); StockCanvas.Children.Add(box6); }
private void Window_Loaded(object sender, RoutedEventArgs e) { InfoShowTimer = new Timer(ShowBoxCheck, null, 0, 2 * 1000); InfoShowTimer.Change(-1, 0); infoshow = new InfoShow(); UserCanvas.Visibility = Visibility.Hidden; total.IsEnabled = false; total.Text = "0"; now.IsEnabled = false; now.Text = "0"; //托盘 notifyIcon.Click += MaxMinMessage; notifyIcon.Text = "股票记录器"; notifyIcon.Icon = Properties.Resources.Icon; System.Windows.Forms.ContextMenuStrip cs = new System.Windows.Forms.ContextMenuStrip(); System.Windows.Forms.ToolStripMenuItem tsm = new System.Windows.Forms.ToolStripMenuItem(); tsm.Text = "关于"; tsm.Click += ShowAbout; cs.Items.Add(tsm); notifyIcon.ContextMenuStrip = cs; notifyIcon.Visible = true; ShowNotifyMessage("程序初始化中!"); //程序开始准备 this.Hide(); StockStateBoxController.Create(ref StockCanvas); UserBoxController.Create(ref UserCanvas); DBDelegateBridge.UIMoney uim = new DBDelegateBridge.UIMoney(GetDelegateValues); DBDelegateBridge.UIStockHold uis = new DBDelegateBridge.UIStockHold(StockStateBoxController.Handler().GetDelegateValues); InfoDelegate.SetWin setwin = new InfoDelegate.SetWin(setWin); UserPanelController UPC = UserPanelController.Create(ref uim, ref uis, ref setwin); Adapter.ErrorAdapter.Show(NetState.Check("0000001")); this.Show(); //UserPanelController.Create(ref UserPanel); //DBSyncController.Handler().SetMoneyDelegate(new DBDataController.ChangeMoney(setPrincipal), new DBDataController.ChangeMoney(setTotal), new DBDataController.ChangeMoney(setNow)); //MoneyEntity ME; //DBSyncController.Handler().MoneyRead(out ME); //total.Text = String.Format("{0:F}", ME.total); //now.Text = String.Format("{0:F}", ME.now); //StockBox(); }