mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 04:18:43 +00:00
User defined launch configurations are loaded when reopening properties
Cleaned up code
This commit is contained in:
parent
c6ece319be
commit
9d4d894aa8
3 changed files with 19 additions and 16 deletions
|
|
@ -451,7 +451,7 @@
|
|||
this.chkEnableStackCorruptionDetection.TabIndex = 8;
|
||||
this.chkEnableStackCorruptionDetection.Text = "Enable Stack Corruption Detection";
|
||||
this.chkEnableStackCorruptionDetection.UseVisualStyleBackColor = true;
|
||||
this.chkEnableStackCorruptionDetection.CheckedChanged += new System.EventHandler(this.chkEnableStacckCorruptionDetection_CheckedChanged);
|
||||
this.chkEnableStackCorruptionDetection.CheckedChanged += new System.EventHandler(this.chkEnableStackCorruptionDetection_CheckedChanged);
|
||||
//
|
||||
// debugLevelGroupBox
|
||||
//
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
|
||||
for (int i = 1; i < 100; i++)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(mViewModel.BuildProperties.GetProperty("User" + i.ToString("000") + "_Name")))
|
||||
if (!String.IsNullOrEmpty(mViewModel.BuildProperties.GetProperty("User" + i.ToString("000") + "_Name")))
|
||||
{
|
||||
FillProfile(i);
|
||||
}
|
||||
|
|
@ -669,7 +669,7 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
{
|
||||
string xValue = mViewModel.GetProjectProperty(xPrefix + xName);
|
||||
// This is important that we dont copy empty values, so instead the defaults will be used.
|
||||
if (!string.IsNullOrWhiteSpace(xValue))
|
||||
if (!String.IsNullOrWhiteSpace(xValue))
|
||||
{
|
||||
mViewModel.BuildProperties.SetProperty(xPrefix + xName, xValue);
|
||||
}
|
||||
|
|
@ -695,6 +695,11 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
{
|
||||
LoadProfileProps(xPreset.Key);
|
||||
}
|
||||
for (int id = 1; id < 100; id++)
|
||||
{
|
||||
var xPrefix = "User" + id.ToString("000");
|
||||
LoadProfileProps(xPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
private void FillProperties()
|
||||
|
|
@ -786,7 +791,7 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
protected List<string> GetNetworkInterfaces()
|
||||
{
|
||||
NetworkInterface[] nInterfaces = NetworkInterface.GetAllNetworkInterfaces();
|
||||
List<string> interfaces_list = new List<string>();
|
||||
var interfaces_list = new List<string>();
|
||||
|
||||
foreach (NetworkInterface nInterface in nInterfaces)
|
||||
{
|
||||
|
|
@ -807,7 +812,7 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
return interfaces_list;
|
||||
}
|
||||
|
||||
private void chkEnableStacckCorruptionDetection_CheckedChanged(object sender, EventArgs e)
|
||||
private void chkEnableStackCorruptionDetection_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!FreezeEvents)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
{
|
||||
internal class OldPropertyManager : IPropertyManager
|
||||
{
|
||||
private BuildProperties mBuildProperties;
|
||||
|
||||
public BuildProperties BuildProperties => mBuildProperties;
|
||||
public BuildProperties BuildProperties { get; }
|
||||
|
||||
public string ProjectPath => mUnconfiguredProject.FullPath;
|
||||
|
||||
|
|
@ -28,14 +26,14 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
|
||||
public OldPropertyManager(UnconfiguredProject unconfiguredProject)
|
||||
{
|
||||
mBuildProperties = new BuildProperties();
|
||||
BuildProperties = new BuildProperties();
|
||||
|
||||
mBuildProperties.PropertyChanged += delegate (object sender, PropertyChangedEventArgs e)
|
||||
BuildProperties.PropertyChanged += delegate (object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new ProjectPropertyChangedEventArgs(e.PropertyName, e.OldValue, e.NewValue));
|
||||
};
|
||||
|
||||
mBuildProperties.PropertyChanging += delegate (object sender, PropertyChangingEventArgs e)
|
||||
BuildProperties.PropertyChanging += delegate (object sender, PropertyChangingEventArgs e)
|
||||
{
|
||||
PropertyChanging?.Invoke(this, new ProjectPropertyChangingEventArgs(e.PropertyName));
|
||||
};
|
||||
|
|
@ -59,7 +57,7 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
}
|
||||
|
||||
public Task<string> GetPropertyAsync(string propertyName) =>
|
||||
Task.FromResult(mBuildProperties.GetProperty(propertyName));
|
||||
Task.FromResult(BuildProperties.GetProperty(propertyName));
|
||||
|
||||
public async Task SetPathPropertyAsync(string propertyName, string value, bool isRelative)
|
||||
{
|
||||
|
|
@ -77,11 +75,11 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
{
|
||||
PropertyChanging?.Invoke(this, new ProjectPropertyChangingEventArgs(propertyName));
|
||||
|
||||
var oldValue = mBuildProperties.GetProperty(propertyName);
|
||||
mBuildProperties.SetProperty(propertyName, value);
|
||||
var oldValue = BuildProperties.GetProperty(propertyName);
|
||||
BuildProperties.SetProperty(propertyName, value);
|
||||
|
||||
PropertyChanged?.Invoke(this, new ProjectPropertyChangedEventArgs(
|
||||
propertyName, oldValue, mBuildProperties.GetProperty(propertyName)));
|
||||
propertyName, oldValue, BuildProperties.GetProperty(propertyName)));
|
||||
|
||||
mIsDirty = true;
|
||||
|
||||
|
|
@ -99,7 +97,7 @@ namespace Cosmos.VS.ProjectSystem.VS.PropertyPages
|
|||
var project = await projectWriteLock.GetProjectAsync(configuredProject);
|
||||
await projectWriteLock.CheckoutAsync(mUnconfiguredProject.FullPath);
|
||||
|
||||
foreach (var property in mBuildProperties.GetProperties())
|
||||
foreach (var property in BuildProperties.GetProperties())
|
||||
{
|
||||
project.SetProperty(property.Key, property.Value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue