Add base scan view model.

This commit is contained in:
2020-08-14 01:55:28 +01:00
parent d4a0a95635
commit 57eec861ce
3 changed files with 98 additions and 0 deletions

View File

@@ -109,6 +109,21 @@ namespace Marechai.Helpers
model.WhiteBalance = WhiteBalance; model.WhiteBalance = WhiteBalance;
model.Comments = Description; model.Comments = Description;
} }
public void ToViewModel(BaseScanViewModel model)
{
model.ScannerManufacturer = Make;
model.ScannerModel = Model;
model.Author = Author;
model.CreationDate = DateTimeOriginal ?? CreateDate ?? ModifyDate;
model.ExifVersion = ExifVersion;
model.HorizontalResolution = XResolution;
model.SoftwareUsed = Software;
model.VerticalResolution = YResolution;
model.ColorSpace = ColorSpace;
model.ResolutionUnit = ResolutionUnit;
model.Comments = Description;
}
} }
internal class ExiftoolDateConverter : JsonConverter<DateTime?> internal class ExiftoolDateConverter : JsonConverter<DateTime?>

View File

@@ -0,0 +1,48 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
using System;
using Marechai.Database;
namespace Marechai.ViewModels
{
public class BaseScanViewModel : BaseViewModel<Guid>
{
public string Author { get; set; }
public ColorSpace? ColorSpace { get; set; }
public string Comments { get; set; }
public DateTime? CreationDate { get; set; }
public string ExifVersion { get; set; }
public double? HorizontalResolution { get; set; }
public ResolutionUnit? ResolutionUnit { get; set; }
public string ScannerManufacturer { get; set; }
public string ScannerModel { get; set; }
public string SoftwareUsed { get; set; }
public DateTime UploadDate { get; set; }
public double? VerticalResolution { get; set; }
public string OriginalExtension { get; set; }
public string UserId { get; set; }
}
}

View File

@@ -0,0 +1,35 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
using Marechai.Database;
namespace Marechai.ViewModels
{
public class DocumentScanBaseViewModel : BaseScanViewModel
{
public DocumentScanType Type { get; set; }
public uint? Page { get; set; }
}
}