//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Tango Observables Generator
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. Do not modify!
//
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;
using Newtonsoft.Json;
using System.Linq;
using Tango.DAL.Remote.DB;
using Tango.Core;
using System.ComponentModel;
using Tango.Core.CustomAttributes;
namespace Tango.BL.Entities
{
[Table("CATS")]
public abstract class CatBase : ObservableEntity
{
public event EventHandler NameChanged;
public event EventHandler DataChanged;
public event EventHandler LiquidTypeChanged;
public event EventHandler MachineChanged;
public event EventHandler RmlChanged;
protected String _name;
///
/// Gets or sets the catbase name.
///
[Column("NAME")]
public String Name
{
get
{
return _name;
}
set
{
if (_name != value)
{
_name = value;
OnNameChanged(value);
}
}
}
protected String _machineguid;
///
/// Gets or sets the catbase machine guid.
///
[Column("MACHINE_GUID")]
[ForeignKey("Machine")]
public String MachineGuid
{
get
{
return _machineguid;
}
set
{
if (_machineguid != value)
{
_machineguid = value;
}
}
}
protected String _rmlguid;
///
/// Gets or sets the catbase rml guid.
///
[Column("RML_GUID")]
[ForeignKey("Rml")]
public String RmlGuid
{
get
{
return _rmlguid;
}
set
{
if (_rmlguid != value)
{
_rmlguid = value;
}
}
}
protected String _liquidtypeguid;
///
/// Gets or sets the catbase liquid type guid.
///
[Column("LIQUID_TYPE_GUID")]
[ForeignKey("LiquidType")]
public String LiquidTypeGuid
{
get
{
return _liquidtypeguid;
}
set
{
if (_liquidtypeguid != value)
{
_liquidtypeguid = value;
}
}
}
protected Byte[] _data;
///
/// Gets or sets the catbase data.
///
[Column("DATA")]
public Byte[] Data
{
get
{
return _data;
}
set
{
if (_data != value)
{
_data = value;
OnDataChanged(value);
}
}
}
protected LiquidType _liquidtype;
///
/// Gets or sets the catbase liquid types.
///
[XmlIgnore]
[JsonIgnore]
public virtual LiquidType LiquidType
{
get
{
return _liquidtype;
}
set
{
if (_liquidtype != value)
{
_liquidtype = value;
if (LiquidType != null)
{
LiquidTypeGuid = LiquidType.Guid;
}
OnLiquidTypeChanged(value);
}
}
}
protected Machine _machine;
///
/// Gets or sets the catbase machine.
///
[XmlIgnore]
[JsonIgnore]
public virtual Machine Machine
{
get
{
return _machine;
}
set
{
if (_machine != value)
{
_machine = value;
if (Machine != null)
{
MachineGuid = Machine.Guid;
}
OnMachineChanged(value);
}
}
}
protected Rml _rml;
///
/// Gets or sets the catbase rml.
///
[XmlIgnore]
[JsonIgnore]
public virtual Rml Rml
{
get
{
return _rml;
}
set
{
if (_rml != value)
{
_rml = value;
if (Rml != null)
{
RmlGuid = Rml.Guid;
}
OnRmlChanged(value);
}
}
}
///
/// Called when the Name has changed.
///
protected virtual void OnNameChanged(String name)
{
NameChanged?.Invoke(this, name);
RaisePropertyChanged(nameof(Name));
}
///
/// Called when the Data has changed.
///
protected virtual void OnDataChanged(Byte[] data)
{
DataChanged?.Invoke(this, data);
RaisePropertyChanged(nameof(Data));
}
///
/// Called when the LiquidType has changed.
///
protected virtual void OnLiquidTypeChanged(LiquidType liquidtype)
{
LiquidTypeChanged?.Invoke(this, liquidtype);
RaisePropertyChanged(nameof(LiquidType));
}
///
/// Called when the Machine has changed.
///
protected virtual void OnMachineChanged(Machine machine)
{
MachineChanged?.Invoke(this, machine);
RaisePropertyChanged(nameof(Machine));
}
///
/// Called when the Rml has changed.
///
protected virtual void OnRmlChanged(Rml rml)
{
RmlChanged?.Invoke(this, rml);
RaisePropertyChanged(nameof(Rml));
}
///
/// Initializes a new instance of the class.
///
public CatBase() : base()
{
}
}
}