Skip to content

Commit

Permalink
Update DatasetModel.Method property
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiMatsuzawa committed Nov 13, 2024
1 parent 09b6895 commit 7fa0f47
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/MSDIAL5/MsdialGuiApp/Model/Core/DatasetModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
using Reactive.Bindings.Notifiers;
using System;
using System.IO;
using System.Reactive.Disposables;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using CompMs.Common.Extension;

namespace CompMs.App.Msdial.Model.Core
{
Expand All @@ -26,6 +26,7 @@ internal sealed class DatasetModel : DisposableModelBase, IDatasetModel
private readonly AnalysisFileBeanModelCollection _analysisFileBeanModelCollection;
private readonly IMessageBroker _broker;
private readonly FilePropertiesModel _projectBaseParameter;
private readonly SerialDisposable _methodDisposable;

public DatasetModel(IMsdialDataStorage<ParameterBase> storage, IMessageBroker broker) : this(storage, new AnalysisFileBeanModelCollection(storage.AnalysisFiles), broker) {

Expand All @@ -44,14 +45,14 @@ public DatasetModel(IMsdialDataStorage<ParameterBase> storage, AnalysisFileBeanM
allProcessMethodSettingModel = new MethodSettingModel(ProcessOption.All, files, _alignmentFileBeanModelCollection, storage, HandlerAsync, _projectBaseParameter, StudyContext, broker);
identificationProcessMethodSettingModel = new MethodSettingModel(ProcessOption.IdentificationPlusAlignment, files, _alignmentFileBeanModelCollection, storage, HandlerAsync, _projectBaseParameter, StudyContext, broker);
alignmentProcessMethodSettingModel = new MethodSettingModel(ProcessOption.Alignment, files, _alignmentFileBeanModelCollection, storage, HandlerAsync, _projectBaseParameter, StudyContext, broker);
_methodDisposable = new SerialDisposable().AddTo(Disposables);
}

public IMethodModel? Method {
get => method;
private set {
var prev = method;
if (SetProperty(ref method, value)) {
prev?.Dispose();
_methodDisposable.Disposable = method;
}
}
}
Expand Down

0 comments on commit 7fa0f47

Please sign in to comment.