Exemple #1
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            if (!_immoValid)
            {
                ribbonFile.Visible = false;
                ribbonActions.Visible = false;
                ribbonAdvancedTuning.Visible = false;
                ribbonManualTuning.Visible = false;
                ribbonOnline.Visible = false;
                rbnPageLogging.Visible = false;
                ribbonProgramming.Visible = false;
                //ribbonProgramming.Visible = false;

                ribbonControl1.SelectedPage = ribbonHelp;
                btnSwitchMode.Enabled = false;
                Application.DoEvents();
            }
            else
            {
                ribbonControl1.SelectedPage = ribbonFile;
                Application.DoEvents();
            }
            SetModeAndFilters();
            _splash.Hide();

            if (m_startFromCommandLine)
            {
                if (File.Exists(m_commandLineFile))
                {
                    OpenWorkingFile(m_commandLineFile);
                }
            }
            else if (m_appSettings.AutoLoadLastFile)
            {
                //check if last opened was a project or a seperate file
                if (m_appSettings.LastOpenedType == 0)
                {
                    if (m_appSettings.Lastfilename != "")
                    {
                        if (File.Exists(m_appSettings.Lastfilename))
                        {
                            if (_immoValid)
                            {
                                OpenWorkingFile(m_appSettings.Lastfilename);
                            }
                        }
                    }
                }
                else
                {
                    if (m_appSettings.Lastprojectname != "")
                    {
                        if (_immoValid)
                        {
                            OpenProject(m_appSettings.Lastprojectname);
                        }
                    }
                }
            }
               // InitSkins();
            try
            {
                m_msiUpdater = new msiupdater(new Version(System.Windows.Forms.Application.ProductVersion));
                m_msiUpdater.Apppath = System.Windows.Forms.Application.UserAppDataPath;
                m_msiUpdater.onDataPump += new msiupdater.DataPump(m_msiUpdater_onDataPump);
                m_msiUpdater.onUpdateProgressChanged += new msiupdater.UpdateProgressChanged(m_msiUpdater_onUpdateProgressChanged);
                m_msiUpdater.CheckForUpdates("Global", "http://develop.trionictuning.com/T5Suite2/", "", "", false);

            }
            catch (Exception E)
            {
                Console.WriteLine("Failed to get initial update: " + E.Message);
            }
            if (IsChristmasTime())
            {
                ShowChristmasWish();
            }
        }