Example #1
0
        public bool validateAssociation(
            String extension,
            String pathToExecute,
            String applicationName)
        {
            String longPathToExecute;
            String longPathAssociated;

            longPathToExecute  = getLongFileName(pathToExecute);
            longPathAssociated = getLongFileName(getAssociatedApp(getTempFile(extension)));

            delTempFile(extension);

            if (longPathToExecute != longPathAssociated)
            {
                if (ask(extension, pathToExecute))
                {
                    fAsk f = new fAsk();
                    f.question  = m_question.Replace("%1", extension);
                    f.dontAsk   = m_dontAsk;
                    f.noButton  = m_noButton;
                    f.yesButton = m_yesButton;

                    f.ShowDialog();

                    if (f.result)
                    {
                        associateFileExtension(extension, pathToExecute, applicationName);
                        return(true);
                    }
                    else
                    {
                        if (f.dontAskAgain)
                        {
                            saveNotAsk(extension, pathToExecute);
                        }
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(true);
            }
        }
        public bool validateAssociation(
            String extension,
            String pathToExecute,
            String applicationName)
        {

            String longPathToExecute;       
            String longPathAssociated;
    
            longPathToExecute = getLongFileName(pathToExecute);
            longPathAssociated = getLongFileName(getAssociatedApp(getTempFile(extension)));
    
            delTempFile (extension);

            if (longPathToExecute != longPathAssociated)
            {
                if (ask(extension, pathToExecute))
                {
                    fAsk f = new fAsk();
                    f.question = m_question.Replace("%1", extension);
                    f.dontAsk = m_dontAsk;
                    f.noButton = m_noButton;
                    f.yesButton = m_yesButton;

                    f.ShowDialog();

                    if (f.result)
                    {
                        associateFileExtension(extension, pathToExecute, applicationName);
                        return true;
                    }
                    else
                    {
                        if (f.dontAskAgain)
                        {
                            saveNotAsk(extension, pathToExecute);
                        }
                        return false;
                    }
                }
                else 
                {
                    return false;
                }
            }
            else
            {
                return true;
            }
        }