Cosmos/source/Cosmos.VS.ProjectSystem/ProjectSystem/VS/PropertyPages/OldCosmosPropertyPageViewModel.cs
2018-02-17 18:01:54 +00:00

43 lines
1.5 KiB
C#

using Microsoft.VisualStudio.ProjectSystem;
using VSPropertyPages;
using Cosmos.Build.Common;
namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
{
internal class OldCosmosPropertyPageViewModel : PropertyPageViewModel
{
private OldPropertyManager mPropertyManager;
private IProjectThreadingService mProjectThreadingService;
public BuildProperties BuildProperties => mPropertyManager.BuildProperties;
public OldCosmosPropertyPageViewModel(
OldPropertyManager propertyManager,
IProjectThreadingService projectThreadingService)
: base(propertyManager, projectThreadingService)
{
mPropertyManager = propertyManager;
mProjectThreadingService = projectThreadingService;
}
public string ProjectPath => mPropertyManager.ProjectPath;
public void LoadProjectProperties()
{
mProjectThreadingService.ExecuteSynchronously(() => mPropertyManager.LoadPropertiesAsync());
}
public void LoadProfile()
{
BuildProperties.Profile = mProjectThreadingService.ExecuteSynchronously(
() => mPropertyManager.GetProjectPropertyAsync(BuildPropertyNames.ProfileString));
}
public string GetProjectProperty(string propertyName)
{
return mProjectThreadingService.ExecuteSynchronously(() => mPropertyManager.GetProjectPropertyAsync(propertyName));
}
}
}