コード例 #1
0
ファイル: FormMain.cs プロジェクト: maxox/Sound-Manager
 /// <summary>
 /// Change the File Association setting
 /// </summary>
 private void checkBoxFileAssoc_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBoxFileAssoc.Checked)
     {
         SoundArchive.AssocFiles();
     }
     else
     {
         SoundArchive.UnAssocFiles();
     }
 }
コード例 #2
0
 /// <summary>
 /// Uninstall will remove application data from the user directory, sound scheme from the registry, and disable all system integration
 /// </summary>
 /// <returns></returns>
 public static void Uninstall()
 {
     if (BgSoundPlayer.RegisteredForStartup)
     {
         BgSoundPlayer.RegisteredForStartup = false;
         foreach (Process process in Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Application.ExecutablePath)))
         {
             if (process.Id != Process.GetCurrentProcess().Id)
             {
                 process.Kill();
             }
         }
     }
     SoundArchive.UnAssocFiles();
     SoundScheme.Uninstall();
     if (Directory.Exists(SoundEvent.DataDirectory))
     {
         Directory.Delete(SoundEvent.DataDirectory, true);
     }
     if (Directory.Exists(DataFolder))
     {
         Directory.Delete(DataFolder, true);
     }
 }