private void frmMain_Load(object sender, EventArgs e)
 {
     // Load Start Page
     frmStartPage frm = new frmStartPage();
     frm.MdiParent = this;
     frm.Show();
 }
 private void frmMain_Load(object sender, EventArgs e)
 {
     UserLookAndFeel.Default.SetSkinStyle("Sharp Plus");
     // Load Start Page
     frmStartPage frm = new frmStartPage();
     frm.MdiParent = this;
     frm.Show();
 }
        private void frmMain_Load(object sender, EventArgs e)
        {
            // Set template
            UserLookAndFeel.Default.SetSkinStyle("Sharp Plus");

            // Set Application Version
            Version vrs = new Version(Application.ProductVersion);
            lblAppVersion.Caption = String.Format("Version: {0}.{1}.{2}", vrs.Major, vrs.Minor, vrs.Build);

            // Load Start Page
            frmStartPage frm = new frmStartPage();
            frm.MdiParent = this;
            frm.ParentFrm = this;
            frm.Show();

            // Load Registration Details
            XPView view = new XPView(Session.DefaultSession, typeof(Database.Registration));
            view.AddProperty("Name", "Name");
            view.AddProperty("Company", "Company");
            bool registered = false;
            foreach (ViewRecord record in view)
            {
                lblRegisteredName.Caption = "Registered To: " + (string)record["Name"];
                registered = true;
            }

            if (!registered)
                lblRegisteredName.Caption = "Registered To: Unregistered";

            // Load Child Forms
            LoadChildrenForms();

            // Set Start Page as Default Page
            foreach (Form mdi in MdiChildren)
            {
                if (mdi is frmStartPage)
                {
                    mdi.Activate();
                }
            }

            // Set Notification Icon
            notifyIcon1.Icon = Icon;

            loaded = true;
        }
        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            bool showStartPage = true;
            foreach (Form mdi in MdiChildren)
            {
                if (mdi is frmStartPage)
                {
                    showStartPage = false;
                    mdi.Activate();
                }
            }

            if (showStartPage)
            {
                frmStartPage frm = new frmStartPage();
                frm.MdiParent = this;
                frm.ParentFrm = this;
                frm.Show();
            }
        }
示例#5
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            richEditControl1.LoadDocument("About Smart Sim Tech.rtf");

            Version vrs = new Version(Application.ProductVersion);
            _AppVersion = String.Format("{0}.{1}.{2}", vrs.Major, vrs.Minor, vrs.Build);

            try
            {
                WebClient getrtf = new WebClient();
                richEditControl2.RtfText = getrtf.DownloadString(_BaseURL + _BaseFile + _AppVersion + _ExtInfo);
            }
            catch (Exception)
            {
                // No Internet Connection
                richEditControl2.Text = "Release notes file not found...";
            }

            // Load USB Device List DataTable
            _usbDeviceList = new DataTable();

            _usbDeviceList.Columns.Add("usbGUID", typeof(string));
            _usbDeviceList.Columns.Add("GUID", typeof(string));
            _usbDeviceList.Columns.Add("cardtype", typeof(string));
            _usbDeviceList.Columns.Add("serial", typeof(int));
            _usbDeviceList.Columns.Add("deviceid", typeof(int));
            _usbDeviceList.Columns.Add("connected", typeof(bool));

            tmrEnumerateUSB.Enabled = true;
            tmrCheckFSUIPC.Enabled = true;

            // Set Application Version
            lblAppVersion.Caption = String.Format("Version: {0}", _AppVersion);

            // Load Start Page
            frmStartPage frm = new frmStartPage();
            frm.MdiParent = this;
            frm.ParentFrm = this;
            frm.Show();

            // Load Registration Details
            XPView view = new XPView(Session.DefaultSession, typeof(Database.Registration));
            view.AddProperty("Name", "Name");
            view.AddProperty("Company", "Company");
            bool registered = false;
            foreach (ViewRecord record in view)
            {
                lblRegisteredName.Caption = "Registered To: " + (string)record["Name"];
                registered = true;
            }

            if (!registered)
                lblRegisteredName.Caption = "Registered To: Unregistered";

            // Load Child Forms
            LoadChildrenForms();

            // Set Start Page as Default Page
            foreach (Form mdi in MdiChildren)
            {
                if (mdi is frmStartPage)
                {
                    mdi.Activate();
                }
            }

            // Set Notification Icon
            notifyIcon1.Icon = Icon;

            // Set CardConnected = false to all records in the cards database
            XPCollection cardsdb = new XPCollection(typeof(Database.Cards));
            foreach (Database.Cards record in cardsdb)
            {
                record.CardConnected = false;
                record.Save();
            }

            loaded = true;

            // Show Window
            Show();
            Refresh();

            _LaunchProcess.ApplicationLoading();

            tmrCloseSplash.Enabled = true;
        }