Exemple #1
0
        private void ButSetPosition_Click(object sender, EventArgs e)
        {
            SetPosition newWin = new SetPosition();

            newWin.MPositionParam = _mPositionParam;
            newWin.SetParam();
            newWin.ShowDialog();
            _mPositionParam   = newWin.MPositionParam;
            TxtOptInfor.Text += "Config Param...\r\n";
            TxtOptInfor.Text += new JavaScriptSerializer {
                MaxJsonLength = Int32.MaxValue
            }.Serialize(_mPositionParam) + "\r\n";
        }
Exemple #2
0
        public PaiPai()
        {
            _mPositionParam = new PositionParam();
            _mLogHelper     = new LogHelper();
            ReadParam();
            SetLogInfor();

            Password newWin = new Password();

            newWin.StrPassword = _mPositionParam.Password;
            newWin.ShowDialog();
            if (!newWin.BEnable)
            {
                return;
            }

            InitializeComponent();

            LabRunStatus.Text = "未开始拍牌";

            TxtOptInfor.Text += "获取网络时间...\r\n请先设置参数\r\n";
            StartPosition     = FormStartPosition.CenterScreen;
            GetLanguage();
            _mNowTime = new DateTime();

            ////启动计时器
            _mbWebTimeClock  = true;
            _mWebClockThread = new Thread(WebTimeClock);
            _mWebClockThread.Start();

            _mbLocalTimeClock  = true;
            _mLocalClockThread = new Thread(LocalTimeClock);
            _mLocalClockThread.Start();

            _mbStartWork = false;

            TxtWebTimeCal.Text   = "0";
            TxtLocalTimeCal.Text = "0";

            RadButLocal.Checked = true;
        }
Exemple #3
0
        private void ReadParam()
        {
            string strPath = AppDomain.CurrentDomain.BaseDirectory + "config.js";

            if (File.Exists(strPath))
            {
                string json = string.Empty;
                using (FileStream fs = new FileStream(strPath, FileMode.Open))
                {
                    using (StreamReader sr = new StreamReader(fs))
                    {
                        json = sr.ReadToEnd();
                        JavaScriptSerializer js = new JavaScriptSerializer();
                        var temp = js.Deserialize <PositionParam>(json);
                        _mPositionParam = temp;
                        sr.Close();
                        fs.Close();
                    }
                }
            }
        }
Exemple #4
0
        public SetPosition()
        {
            InitializeComponent();
            MPositionParam = new PositionParam();

//             TxtAdd300.Text = "678,440";
//             TxtAdd200.Text = "753,440";
//             TxtAdd100.Text = "830,440";
//             TxtLess300.Text = "678,404";
//             TxtLess200.Text = "753,404";
//             TxtLess100.Text = "830,404";
//             TxtBid.Text = "830,475";
//             TxtAddOrder.Text = "830,365";
//             TxtPrice.Text = "300";
//             BidTime.Format = DateTimePickerFormat.Time;
//             AddPriceTime.Format = DateTimePickerFormat.Time;
//             BidTime.Value = Convert.ToDateTime("11:29:50");
//             AddPriceTime.Value = Convert.ToDateTime("11:29:46");
//             TxtUrl.Text = "http://moni.51hupai.org/";

            GetLanguage();
        }