Ejemplo n.º 1
0
        private void MDIParent1_Load(object sender, EventArgs e)
        {
            Thread myth = new System.Threading.Thread(delegate()
            {
                csv.CSV_Class.contract_fun();
            });
            myth.Start();
            Global.Instance.warningvar = false;
            Global.Instance.ReloginFarmloader = false;
            Global.Instance.SignInStatus = false;
            Global.Instance.Pass_bool = false;
            Global.Instance.Fopairbool = false;
            Global.Instance.stop_all = false;
            NNFInOut.Instance.OnDataAPPTYPEStatusChange += OnDataAPPTYPE;
            NNFInOut.Instance.OnStatusChange += Instance_OnStatusChange;
            NNFHandler.Instance.OnStatusChangeHeartBeatInfo += ChangeHeartBeatInfo;
            UDP_Reciever.Instance.OnDataStatusChange += Instance_OndatastopChange;
            NNFHandler.Instance.OnStatusChange += Instance_OnStatusChange;

            NNFHandler.Instance._socketfun();
            NNFHandler.Instance.RecieveDataAsClient();
            LzoNanoData.Instance.UDPReciever();
            _frmNewLogin = new frmLogin();
            _frmNewLogin.ShowDialog();

            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
            timer.Interval = 1000;
               timer.Tick += new System.EventHandler(timer_Tick);
            timer.Start();

            Client.Spread.CommonData.LoadSymbols("spd_contract.txt", Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + "ContractFile" + Path.DirectorySeparatorChar, Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + Path.DirectorySeparatorChar + "Settings" + Path.DirectorySeparatorChar + "spd.ini");
            //int c = 1;
            //while (Global.Instance.Pass_bool != false)
            //{

            //    _frmNewLogin.Hide();

            //    //_frmNewLogin.Dispose();
            //    //_frmNewLogin = new frmLogin();
            //    _frmNewLogin.ShowDialog();
            //    c++;
            //    if (c==3)
            //    {
            //        logout();
            //        break;
            //    }
            //}

            if (Global.Instance.SignInStatus == false)
            {
                MessageBox.Show("SignInStatus  :" + Global.Instance.SignInStatus);
                this.Hide();
                logout();
            }
        }
        private void MDIParent1_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.Timer tmr = new System.Windows.Forms.Timer();
            tmr.Interval = 1000;//ticks every 1 second
            tmr.Tick += new EventHandler(tmr_Tick);
               // tmr.Start();

            Global.Instance.warningvar = false;
            Global.Instance.SignInStatus = false;
            Global.Instance.Pass_bool = false;
            Global.Instance.Fopairbool = false;
            Global.Instance.ReloginFarmloader = false;
            NNFInOut.Instance.OnDataAPPTYPEStatusChange += OnDataAPPTYPE;
            NNFInOut.Instance.OnStatusChange += Instance_OnStatusChange;
            NNFHandler.Instance.OnStatusChangeHeartBeatInfo += ChangeHeartBeatInfo;
            UDP_Reciever.Instance.OnDataStatusChange += Instance_OndatastopChange;
            NNFHandler.Instance.OnStatusChange += Instance_OnStatusChange;

            NNFHandler.Instance._socketfun();
            NNFHandler.Instance.RecieveDataAsClient();

            LZO_NanoData.LzoNanoData.Instance.UDPReciever();
            _frmNewLogin = new frmLogin();
            _frmNewLogin.ShowDialog();
            //int c = 1;
            //while (Global.Instance.Pass_bool != false)
            //{

            //    _frmNewLogin.Hide();

            //    //_frmNewLogin.Dispose();
            //    //_frmNewLogin = new frmLogin();
            //    _frmNewLogin.ShowDialog();
            //    c++;
            //    if (c==3)
            //    {
            //        logout();
            //        break;
            //    }
            //}

            if (Global.Instance.SignInStatus == false)
            {
                MessageBox.Show("SignInStatus  :" + Global.Instance.SignInStatus);
                this.Hide();
                logout();
            }
        }