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

43 lines
2 KiB
C#

using System;
using System.Windows;
using Microsoft.VisualStudio.Setup.Configuration;
namespace Cosmos.Build.Builder.Services.VisualStudioSetup
{
internal class VisualStudioSetupFailedPackageReference : VisualStudioSetupPackageReference, ISetupFailedPackageReference3
{
private ISetupFailedPackageReference3 _setupFailedPackageReference;
public VisualStudioSetupFailedPackageReference(ISetupFailedPackageReference3 setupFailedPackageReference)
: base(setupFailedPackageReference)
{
_setupFailedPackageReference = setupFailedPackageReference;
}
string ISetupFailedPackageReference3.GetType() => RunOnMainThread(_setupFailedPackageReference.GetType);
public string GetLogFilePath() => RunOnMainThread(_setupFailedPackageReference.GetLogFilePath);
public string GetDescription() => RunOnMainThread(_setupFailedPackageReference.GetDescription);
public string GetSignature() => RunOnMainThread(_setupFailedPackageReference.GetSignature);
public string[] GetDetails() => RunOnMainThread(_setupFailedPackageReference.GetDetails);
public ISetupPackageReference[] GetAffectedPackages()
{
var packages = RunOnMainThread(_setupFailedPackageReference.GetAffectedPackages);
for (int i = 0; i < packages.Length; i++)
{
packages[i] = new VisualStudioSetupPackageReference(packages[i]);
}
return packages;
}
public string GetAction() => RunOnMainThread(_setupFailedPackageReference.GetAction);
public string GetReturnCode() => RunOnMainThread(_setupFailedPackageReference.GetReturnCode);
string ISetupFailedPackageReference2.GetType() => RunOnMainThread(_setupFailedPackageReference.GetType);
string ISetupFailedPackageReference.GetType() => RunOnMainThread(_setupFailedPackageReference.GetType);
private static T RunOnMainThread<T>(Func<T> function) => Application.Current.Dispatcher.Invoke(function);
}
}