agrobot_base/AgroBase/OperationControl/Mapas/Editing/MapaEdicaoHistoricoItem.cs

85 lines
1.8 KiB
C#

using OperationControl.Mapas.Models;
namespace OperationControl.Mapas.Editing
{
internal sealed class MapaEdicaoSnapshot
{
public MapaDocumento Documento
{
get;
}
public IReadOnlyCollection<string>
RuasSelecionadas
{
get;
}
public MapaEdicaoSnapshot(
MapaDocumento documento,
IEnumerable<string> ruasSelecionadas)
{
Documento =
documento
?? throw new ArgumentNullException(
nameof(documento)
);
RuasSelecionadas =
new HashSet<string>(
ruasSelecionadas
?? Array.Empty<string>(),
StringComparer.OrdinalIgnoreCase
);
}
}
internal sealed class MapaEdicaoHistoricoItem
{
public string Descricao
{
get;
}
public MapaEdicaoSnapshot Antes
{
get;
}
public MapaEdicaoSnapshot Depois
{
get;
}
public MapaEdicaoHistoricoItem(
string descricao,
MapaEdicaoSnapshot antes,
MapaEdicaoSnapshot depois)
{
Descricao =
string.IsNullOrWhiteSpace(
descricao
)
? "Alteração no mapa"
: descricao.Trim();
Antes =
antes
?? throw new ArgumentNullException(
nameof(antes)
);
Depois =
depois
?? throw new ArgumentNullException(
nameof(depois)
);
}
}
}