コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: zjxbetter/gupiao
        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();
        }
コード例 #2
0
 //错误的股票编号测试
 public void NetstatCheckReqErrorTest()
 {
     Assert.AreEqual(NET_ERROR.NET_REQ_ERROR, NetState.Check("1600001"));
 }
コード例 #3
0
 //正确的股票编号测试
 public void NetstatCheckReqOkTest()
 {
     Assert.AreEqual(NET_ERROR.NET_REQ_OK, NetState.Check("0600001"));
 }