コード例 #1
0
 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
		public override TargetFramework PickFramework(IEnumerable<IUpgradableProject> selectedProjects)
		{
			if (ProfileList.IsPortableLibraryInstalled()) {
				SelectProfileDialog dlg = new SelectProfileDialog(ProfileList.Instance);
				dlg.Owner = SD.Workbench.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;
		}