public override TargetFramework PickFramework(IEnumerable <IUpgradableProject> selectedProjects)
 {
     if (ProfileList.IsPortableLibraryInstalled())
     {
         SelectProfileDialog dlg = new SelectProfileDialog(ProfileList.Instance);
         dlg.Owner = WorkbenchSingleton.MainWindow;
         if (selectedProjects != null)
         {
             var project = selectedProjects.FirstOrDefault() as CompilableProject;
             if (project != null)
             {
                 Profile profile = Profile.LoadProfile(project.TargetFrameworkVersion, project.TargetFrameworkProfile);
                 if (profile != null)
                 {
                     dlg.SelectedProfile = profile;
                 }
             }
         }
         if (dlg.ShowDialog() == true && dlg.SelectedProfile != null)
         {
             return(new PortableTargetFramework(dlg.SelectedProfile));
         }
     }
     else
     {
         new CheckPortableLibraryInstalled().Run();
     }
     return(null);
 }
예제 #2
0
 void LoadProfiles(string targetFrameworkVersion, string profilesDir)
 {
     string[] profileDirs;
     try {
         profileDirs = Directory.GetDirectories(profilesDir);
     } catch (IOException) {
         return;
     } catch (UnauthorizedAccessException) {
         return;
     }
     foreach (string profileDir in profileDirs)
     {
         string targetFrameworkProfile = Path.GetFileName(profileDir);
         var    profile = Profile.LoadProfile(targetFrameworkVersion, targetFrameworkProfile, profileDir);
         if (profile != null)
         {
             list.Add(profile);
         }
     }
 }