Files
cms_thermo_active/Step.Model/DTOModels/DTOProcessDataModel.cs
T
Lucio Maranta b0b7659ada * Refactored configuration
* Added Selected process and select process action
* Added Heads signalR and configuration
2018-03-14 17:36:13 +01:00

47 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.Linq;
using static CMS_CORE_Library.DataStructures;
namespace Step.Model.DTOModels
{
public class DTOProcessDataModel
{
public bool isRunning;
public ushort selectedProcess;
public List<ProcessDataModel> processes;
public DTOProcessDataModel()
{
isRunning = false;
processes = new List<ProcessDataModel>();
}
public override bool Equals(object obj)
{
var item = obj as DTOProcessDataModel;
// Object is not a DTOProcessDataModel instance
if (item == null)
return false;
if (isRunning != item.isRunning)
return false;
if (selectedProcess != item.selectedProcess)
return false;
// If the numbers of the list's elemets are different, lists are different
if (item.processes.Count != processes.Count)
return false;
// Check list's elements
bool listAreEquals = item.processes.All(processes.Contains);
if (!listAreEquals)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}