Cosmos/source/Cosmos.Build.Builder/Services/VisualStudioSetup/VisualStudioSetupErrorInfo.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

22 lines
814 B
C#

using System;
using System.Windows;
using Microsoft.VisualStudio.Setup.Configuration;
namespace Cosmos.Build.Builder.Services.VisualStudioSetup
{
internal class VisualStudioSetupErrorInfo : ISetupErrorInfo
{
private ISetupErrorInfo _setupErrorInfo;
public VisualStudioSetupErrorInfo(ISetupErrorInfo setupErrorInfo)
{
_setupErrorInfo = setupErrorInfo;
}
public int GetErrorHResult() => RunOnMainThread(_setupErrorInfo.GetErrorHResult);
public string GetErrorClassName() => RunOnMainThread(_setupErrorInfo.GetErrorClassName);
public string GetErrorMessage() => RunOnMainThread(_setupErrorInfo.GetErrorMessage);
private static T RunOnMainThread<T>(Func<T> function) => Application.Current.Dispatcher.Invoke(function);
}
}