105040 使用FormUISettings保存配置项
This commit is contained in:
parent
9d6dc663d9
commit
a8815b8f9a
|
@ -1,5 +1,6 @@
|
||||||
using EPLAN.Harness.Common.Extensions;
|
using EPLAN.Harness.Common.Extensions;
|
||||||
using EPLAN.Harness.Core.Controls;
|
using EPLAN.Harness.Core.Controls;
|
||||||
|
using EPLAN.Harness.Core.Settings;
|
||||||
using EPLAN.Harness.ProjectCore.Report;
|
using EPLAN.Harness.ProjectCore.Report;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||||
|
@ -134,6 +135,8 @@ public partial class MainViewModel : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
_flagType = value;
|
_flagType = value;
|
||||||
OnPropertyChanged(nameof(FlagType));
|
OnPropertyChanged(nameof(FlagType));
|
||||||
|
FormUISettings.Instance.SetValue("FlagType", $"{FlagType}");
|
||||||
|
FormUISettings.Instance.SaveSingleton();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -156,6 +159,15 @@ public partial class MainViewModel : INotifyPropertyChanged
|
||||||
|
|
||||||
public Task<List<ReportModel>> LoadReportDataAsync(IEnumerable<BaseReportEntry> data, List<ReportColumn> columns)
|
public Task<List<ReportModel>> LoadReportDataAsync(IEnumerable<BaseReportEntry> data, List<ReportColumn> columns)
|
||||||
{
|
{
|
||||||
|
var savedFlagType = FormUISettings.Instance.GetValue("FlagType");
|
||||||
|
if (Enum.IsDefined(typeof(WireFlagType), savedFlagType))
|
||||||
|
{
|
||||||
|
FlagType = (WireFlagType)Enum.Parse(typeof(WireFlagType), savedFlagType.ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FlagType = WireFlagType.Dual;
|
||||||
|
}
|
||||||
var reportDatas = new ConcurrentBag<ReportModel>();
|
var reportDatas = new ConcurrentBag<ReportModel>();
|
||||||
//foreach (var entry in data)
|
//foreach (var entry in data)
|
||||||
data.AsParallel().WithDegreeOfParallelism(8).ForAll(entry =>
|
data.AsParallel().WithDegreeOfParallelism(8).ForAll(entry =>
|
||||||
|
@ -382,6 +394,8 @@ public partial class MainViewModel : INotifyPropertyChanged
|
||||||
private void OnPropertyChanged(string propertyName)
|
private void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
//new StudioSettings().Plugins.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue