Cosmos/source/Cosmos.Build.Builder/Services/VisualStudioSetup/VisualStudioSetupPropertyStore.cs
José Pedro f969601a53
Builder improvements.
- Added check for dependencies, which can be installed from the builder.
- Replaced CosmosTask with CosmosBuildDefinition, which is much simpler.
- The builder can be opened without any command line arguments.
- If the VS path is not specified as a command line argument, it can be selected in a dialog.
2018-03-30 19:44:19 +01:00

21 lines
769 B
C#

using System;
using System.Windows;
using Microsoft.VisualStudio.Setup.Configuration;
namespace Cosmos.Build.Builder.Services.VisualStudioSetup
{
internal class VisualStudioSetupPropertyStore : ISetupPropertyStore
{
private ISetupPropertyStore _setupPropertyStore;
public VisualStudioSetupPropertyStore(ISetupPropertyStore setupPropertyStore)
{
_setupPropertyStore = setupPropertyStore;
}
public string[] GetNames() => RunOnMainThread(_setupPropertyStore.GetNames);
public object GetValue(string pwszName) => RunOnMainThread(() => _setupPropertyStore.GetValue(pwszName));
private static T RunOnMainThread<T>(Func<T> function) => Application.Current.Dispatcher.Invoke(function);
}
}