first commit
This commit is contained in:
72
DCIT.Core/Models/FileScanItem.cs
Normal file
72
DCIT.Core/Models/FileScanItem.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace DCIT.Core.Models
|
||||
{
|
||||
public class FileScanItem : INotifyPropertyChanged
|
||||
{
|
||||
private bool _isSelected = true;
|
||||
private string _sourcePath;
|
||||
private string _outputPath;
|
||||
private string _diffPath;
|
||||
private int _textOperationCount;
|
||||
private int _imageOperationCount;
|
||||
private ProcessingStatus _status = ProcessingStatus.Pending;
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get { return _isSelected; }
|
||||
set { SetField(ref _isSelected, value); }
|
||||
}
|
||||
|
||||
public string SourcePath
|
||||
{
|
||||
get { return _sourcePath; }
|
||||
set { SetField(ref _sourcePath, value); }
|
||||
}
|
||||
|
||||
public string OutputPath
|
||||
{
|
||||
get { return _outputPath; }
|
||||
set { SetField(ref _outputPath, value); }
|
||||
}
|
||||
|
||||
public string DiffPath
|
||||
{
|
||||
get { return _diffPath; }
|
||||
set { SetField(ref _diffPath, value); }
|
||||
}
|
||||
|
||||
public int TextOperationCount
|
||||
{
|
||||
get { return _textOperationCount; }
|
||||
set { SetField(ref _textOperationCount, value); }
|
||||
}
|
||||
|
||||
public int ImageOperationCount
|
||||
{
|
||||
get { return _imageOperationCount; }
|
||||
set { SetField(ref _imageOperationCount, value); }
|
||||
}
|
||||
|
||||
public ProcessingStatus Status
|
||||
{
|
||||
get { return _status; }
|
||||
set { SetField(ref _status, value); }
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(field, value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
field = value;
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user