Files
jdescopingtool/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataSyncFormViewModel.cs
T
Joseph Doherty 227a749cdf docs: add XML documentation to NEW solution src files
Fix 173 of 175 documentation issues across 48 files using CommentChecker,
adding missing <summary>, <param>, and <inheritdoc /> tags to public APIs.
2026-01-27 06:19:20 -05:00

161 lines
4.2 KiB
C#

using JdeScoping.ConfigManager.Models;
namespace JdeScoping.ConfigManager.ViewModels.Forms;
/// <summary>
/// ViewModel for editing DataSync configuration section.
/// </summary>
public class DataSyncFormViewModel : ViewModelBase
{
private readonly DataSyncSection _model;
private readonly Action _onChanged;
/// <summary>
/// Initializes a new instance of the <see cref="DataSyncFormViewModel"/> class.
/// </summary>
/// <param name="model">The data sync section model to edit.</param>
/// <param name="onChanged">The callback to invoke when configuration changes.</param>
public DataSyncFormViewModel(DataSyncSection model, Action onChanged)
{
_model = model ?? throw new ArgumentNullException(nameof(model));
_onChanged = onChanged ?? throw new ArgumentNullException(nameof(onChanged));
}
/// <summary>
/// Gets or sets whether data synchronization is enabled.
/// </summary>
public bool Enabled
{
get => _model.Enabled;
set
{
if (_model.Enabled != value)
{
_model.Enabled = value;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the check interval in minutes.
/// </summary>
public int CheckIntervalMinutes
{
get => (int)_model.CheckInterval.TotalMinutes;
set
{
var newValue = TimeSpan.FromMinutes(value);
if (_model.CheckInterval != newValue)
{
_model.CheckInterval = newValue;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the maximum degree of parallelism.
/// </summary>
public int MaxDegreeOfParallelism
{
get => _model.MaxDegreeOfParallelism;
set
{
if (_model.MaxDegreeOfParallelism != value)
{
_model.MaxDegreeOfParallelism = value;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the batch size for sync operations.
/// </summary>
public int BatchSize
{
get => _model.BatchSize;
set
{
if (_model.BatchSize != value)
{
_model.BatchSize = value;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the bulk copy batch size.
/// </summary>
public int BulkCopyBatchSize
{
get => _model.BulkCopyBatchSize;
set
{
if (_model.BulkCopyBatchSize != value)
{
_model.BulkCopyBatchSize = value;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the lookback multiplier.
/// </summary>
public double LookbackMultiplier
{
get => _model.LookbackMultiplier;
set
{
if (Math.Abs(_model.LookbackMultiplier - value) > 0.001)
{
_model.LookbackMultiplier = value;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the purge retention days.
/// </summary>
public int PurgeRetentionDays
{
get => _model.PurgeRetentionDays;
set
{
if (_model.PurgeRetentionDays != value)
{
_model.PurgeRetentionDays = value;
OnPropertyChanged();
_onChanged();
}
}
}
/// <summary>
/// Gets or sets the sync timeout in seconds.
/// </summary>
public int SyncTimeoutSeconds
{
get => _model.SyncTimeoutSeconds;
set
{
if (_model.SyncTimeoutSeconds != value)
{
_model.SyncTimeoutSeconds = value;
OnPropertyChanged();
_onChanged();
}
}
}
}