mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
- 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.
43 lines
2 KiB
C#
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);
|
|
}
|
|
}
|