Ejemplo n.º 1
0
        private void checkFileAssociations()
        {
            string openCmd = Project.GetLongPathName(Application.ExecutablePath) + " \"%1\"";

            FileAssociation FA = new FileAssociation();
            FA.Extension = "gpx";
            FA.AddCommand("open", openCmd);

            associateGpxCheckBox.Checked = !FA.Test();
            associateGpxCheckBox.Enabled = true;
            assocGpxLabel.Visible = !associateGpxCheckBox.Checked;

            FA = new FileAssociation();
            FA.Extension = "loc";
            FA.AddCommand("open", openCmd);

            associateLocCheckBox.Checked = !FA.Test();
            associateLocCheckBox.Enabled = true;
            assocLocLabel.Visible = !associateLocCheckBox.Checked;

            FA = new FileAssociation();
            FA.Extension = "gpz";
            FA.AddCommand("open", openCmd);

            associateGpzCheckBox.Checked = !FA.Test();
            associateGpzCheckBox.Enabled = true;
            assocGpzLabel.Visible = !associateGpzCheckBox.Checked;
        }
Ejemplo n.º 2
0
        private void _hideGreeting()
        {
            /*
            if(m_daysSinceInstall >= Project.SPOILER_DAYS_START && !MyLicense.unlocked)
            {
                //new DlgExplainSpoiling().Show();
            }
            */

            //this.Focus();
            //this.BringToFront();	// main form to front

            TileCache.greetingForm = null;
            try
            {
                if(m_greetingForm != null)
                {
                    //m_greetingForm.Hide();
                    m_greetingForm.Close();
                    m_greetingForm = null;
                }
                if(m_greetingThread != null)
                {
                    Thread.Sleep(500);		// let the dialog close before we abort the thread
                    m_greetingThread.Abort();
                    m_greetingThread = null;
                }
            }
            catch
            {
            }

            this.hintsPanel.Visible = Project.showHelpAtStart && (m_args.Length == 0) && !hintsPanelClicked;

            try
            {
                bool allAssociated;
                string openCmd = Project.GetLongPathName(Application.ExecutablePath) + " \"%1\"";

                FileAssociation FA = new FileAssociation();
                FA.Extension = "loc";
                FA.AddCommand("open", openCmd);

                allAssociated = FA.Test();

                if(allAssociated)
                {
                    FA = new FileAssociation();
                    FA.Extension = "gpx";
                    FA.AddCommand("open", openCmd);

                    allAssociated = FA.Test();
                }

                if(allAssociated)
                {
                    FA = new FileAssociation();
                    FA.Extension = "gpz";
                    FA.AddCommand("open", openCmd);

                    allAssociated = FA.Test();
                }

                this.notAssociatedButton.Visible = !allAssociated;
                this.notAssociatedLabel.Visible = !allAssociated;
            }
            catch {}

            if(!hasShownUpdateForm && Project.upgradeMessage.Length > 0)
            {
                hasShownUpdateForm = true;
                new DlgUpgradeMessage(Project.upgradeMessage).ShowDialog();
            }
            else
            {
                //Thread.Sleep(1000);
                this.Focus();
                this.BringToFront();	// main form to front
            }
        }