Example #1
0
 private void SetupFileAssociations()
 {
     if (!StaticSettings.HasFileTypeAssociations())
     {
         MessageBoxResult result = MessageBox.Show("Always use this application to open .qif files?", "File Type Association", MessageBoxButton.YesNo);
         if (result == MessageBoxResult.Yes)
         {
             string exeName  = AppDomain.CurrentDomain.FriendlyName;
             string exePath  = System.Reflection.Assembly.GetEntryAssembly().Location;
             string iconPath = System.IO.Path.Combine(Environment.CurrentDirectory, "Resources", "Icon.bmp");
             string errors   = StaticSettings.CreateFileTypeAssociations(exeName, exePath, iconPath);
             if (!string.IsNullOrWhiteSpace(errors))
             {
                 MessageBox.Show(errors);
             }
         }
     }
 }