227a749cdf
Fix 173 of 175 documentation issues across 48 files using CommentChecker, adding missing <summary>, <param>, and <inheritdoc /> tags to public APIs.
88 lines
2.8 KiB
C#
88 lines
2.8 KiB
C#
using JdeScoping.DataSync.Configuration;
|
|
|
|
namespace JdeScoping.ConfigManager.ViewModels.PipelineSteps;
|
|
|
|
/// <summary>
|
|
/// View model for the destination step in a pipeline.
|
|
/// </summary>
|
|
public class DestinationStepViewModel : PipelineStepViewModelBase
|
|
{
|
|
private readonly DestinationElement _model;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="DestinationStepViewModel"/> class.
|
|
/// </summary>
|
|
/// <param name="model">The destination configuration model.</param>
|
|
/// <param name="onChanged">Callback invoked when the destination configuration changes.</param>
|
|
public DestinationStepViewModel(DestinationElement model, Action onChanged) : base(onChanged)
|
|
{
|
|
_model = model ?? throw new ArgumentNullException(nameof(model));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override PipelineStepType StepType => PipelineStepType.Destination;
|
|
|
|
/// <inheritdoc />
|
|
public override string DisplayName => "Destination";
|
|
|
|
/// <inheritdoc />
|
|
public override string Icon => ""; // mdi-database
|
|
|
|
/// <inheritdoc />
|
|
public override string Summary => !string.IsNullOrEmpty(Table) ? $"→ {Table}" : "(no table)";
|
|
|
|
/// <summary>
|
|
/// Gets or sets the destination table name.
|
|
/// </summary>
|
|
public string Table
|
|
{
|
|
get => _model.Table;
|
|
set
|
|
{
|
|
if (_model.Table != value)
|
|
{
|
|
_model.Table = value ?? string.Empty;
|
|
OnPropertyChanged();
|
|
OnPropertyChanged(nameof(Summary));
|
|
NotifyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets the match columns as newline-separated text.
|
|
/// </summary>
|
|
public string MatchColumnsText
|
|
{
|
|
get => string.Join("\n", _model.MatchColumns);
|
|
set
|
|
{
|
|
var columns = (value ?? string.Empty).Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList();
|
|
if (!_model.MatchColumns.SequenceEqual(columns))
|
|
{
|
|
_model.MatchColumns = columns;
|
|
OnPropertyChanged();
|
|
NotifyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets the columns to exclude from updates as newline-separated text.
|
|
/// </summary>
|
|
public string ExcludeFromUpdateText
|
|
{
|
|
get => string.Join("\n", _model.ExcludeFromUpdate);
|
|
set
|
|
{
|
|
var columns = (value ?? string.Empty).Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList();
|
|
if (!_model.ExcludeFromUpdate.SequenceEqual(columns))
|
|
{
|
|
_model.ExcludeFromUpdate = columns;
|
|
OnPropertyChanged();
|
|
NotifyChanged();
|
|
}
|
|
}
|
|
}
|
|
}
|