public Workspace( FeaturePack features, string workspaceKind) : this( GetWorkspaceServiceProviderFactory(features).CreateWorkspaceServiceProvider(workspaceKind)) { }
private MSBuildWorkspace( FeaturePack features, ImmutableDictionary<string, string> properties) : base(features, "MSBuildWorkspace") { // always make a copy of these build properties (no mutation please!) this.properties = properties ?? ImmutableDictionary<string, string>.Empty; this.SetSolutionProperties(solutionFilePath: null); }
internal static IWorkspaceServiceProviderFactory GetWorkspaceServiceProviderFactory(FeaturePack features) { IWorkspaceServiceProviderFactory factory; if (!factories.TryGetValue(features, out factory)) { factory = factories.GetValue(features, CreateWorkspaceServiceProviderFactory); } return factory; }
private static IWorkspaceServiceProviderFactory CreateWorkspaceServiceProviderFactory(FeaturePack features) { var exports = features.ComposeExports(); var factory = exports.GetExports<IWorkspaceServiceProviderFactory>().Single().Value; #if MEF // need to tell factory about export source since it is constructed via MEF and the export source is not part of the MEF composition. ((WorkspaceServiceProviderFactory)factory).SetExports(exports); #endif return factory; }
/// <summary> /// Create a new instance of a workspace that can be populated by opening solution and project files. /// </summary> /// <param name="properties">The MSBuild properties used when interpretting project files. /// These are the same properties that are passed to msbuild via the /property:<n>=<v> command line argument.</param> /// <param name="features">The feature pack used to configure this workspace.</param> public static MSBuildWorkspace Create(ImmutableDictionary<string, string> properties, FeaturePack features) { if (properties == null) { throw new ArgumentNullException("properties"); } if (features == null) { throw new ArgumentNullException("features"); } return new MSBuildWorkspace(features, properties); }
private static FeaturePack GetTestWorkspaceFeatures() { if (testWorkspaceFeatures == null) { AssemblyCatalog assemblyCatalog = new AssemblyCatalog(typeof(SolutionTests).Assembly); MefExportPack mefExportPack = new MefExportPack(assemblyCatalog); testWorkspaceFeatures = WellKnownFeatures.Features.Combine(mefExportPack); } return testWorkspaceFeatures; }
public CustomWorkspace(FeaturePack features, string workspaceKind = WorkspaceKind.Host) : base(features, workspaceKind) { }