Exemplo n.º 1
0
        /// <summary>
        /// Check if the application project file, specified in application stettings, is associated with the application and associates it, if requested
        /// </summary>
        /// <param name="showMessageIfAssociated">Specifies if a message should been shown if the application project file, specified in application stettings, is already associated with application</param>
        internal static void CheckFileAssociationAndSet(bool showMessageIfAssociated)
        {
            // Get Path to Icon
            string IconPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            IconPath += @"\";
            IconPath += Settings.Default.FileAssociation_ExtensionIconFile;

            // Check File Association
            FileAssociation.CheckMatchWithApplicationAndSet(
                Application.ExecutablePath,
                "." + Settings.Default.ProjectFile_DefaultExtension,
                Settings.Default.ProjectFile_DefaultExtension,
                Settings.Default.FileAssociation_ExtensionFile,
                Settings.Default.FileAssociation_ExtensionDescription,
                IconPath,
                showMessageIfAssociated);
        }