Ejemplo n.º 1
0
 private void InitAll()
 {
     #region [ Build param ]
     _core.InitAll();
     #endregion
     #region [ SetStatusBar ]
     SetStatusBar();
     #endregion
     _core.TempPath = _core.CacheGetStr("frmOption_TempPath", "");
 }
Ejemplo n.º 2
0
        private void InitAll()
        {
            #region [ Building events ... ]
            MainForm._splash.SetStatus("Building events ...");
            System.Windows.Forms.Application.DoEvents();

            InitEvents();
            #endregion
            #region [ Building lock timeout ... ]
            MainForm._splash.SetStatus("Building timer ...");
            System.Windows.Forms.Application.DoEvents();

            _directClose = true;

            int locktimeout = 1;
            try
            {
                locktimeout = _core.CacheGetInt("frmOption_LockTimeOut", 99);
            }
            catch { }

            _timer          = new System.Windows.Forms.Timer();
            _timer.Interval = 1000;
            _timer.Tick    += _timer_Tick;
            _timer.Enabled  = true;
            #endregion
            #region [ Build param ]
            MainForm._splash.SetStatus("Building parameter...");
            System.Windows.Forms.Application.DoEvents();

            //_core.RemoteObject.InitALL();
            _core.InitAll();
            #endregion
            #region [ Set status ]
            MainForm._splash.SetStatus("Building status ...");
            System.Windows.Forms.Application.DoEvents();

            //Stream stream = _core.Resource.GetStream("hpro_icon");

            //_core.icon = new System.Drawing.Icon(stream);

            this.Text = "InfoPos";
            //this.Icon = _core.icon;

            #endregion
            #region [ Set Menu Settings ]
            MainForm._splash.SetStatus("Building menu ...");
            System.Windows.Forms.Application.DoEvents();

            #endregion
            #region [ Set Outlook menu Settings ]
            SetLeftMenu();
            #endregion
            #region [ Set StatusBar ]
            SetStatusBar();
            #endregion
            #region [ Building dictionary ... ]
            MainForm._splash.SetStatus("Building dictionary ...");
            System.Windows.Forms.Application.DoEvents();

            try
            {
                string          filename = "ism.dicdata.dll";
                BinaryFormatter bf       = new BinaryFormatter();
                using (FileStream fs = new FileStream(filename, FileMode.Open))
                {
                    _core.Dictionary = (DataSet)bf.Deserialize(fs);
                    fs.Flush();
                    fs.Close();
                }
            }
            catch (Exception ex)
            {
                this.Close();
            }
            #endregion
            _core.MainForm = this;
            _directClose   = false;
            //frmDashboard frm = new frmDashboard(_core);
            //frm.MdiParent = _core.MainForm;
            //frm.Dock = DockStyle.Fill;
            //frm.Show();
            _core.TempPath = _core.CacheGetStr("frmOption_TempPath", "");
            //_core.TxnDateChanged += new InfoPos.Core.Core.dlgServerDateChanged(_core_TxnDateChanged);
            //_core.MsgRecv += new InfoPos.Core.Core.dlgMsgRecv(_core_MsgRecv);
            #region [Terminal Message]
            timer       = new System.Windows.Forms.Timer();
            timer.Tick += timer_Tick;
            //_core.HeavenProMessages += new InfoPos.Core.Core.dlgHeavenProMessages(_core_HeavenProMessages);
            timer.Interval = 1000;
            timer.Enabled  = true;
            #endregion
        }