//------------------------------------------------------------------------------
//
// 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("DATA_STORE_ITEMS")]
public abstract class DataStoreItemBase : ObservableEntity
{
public event EventHandler CollectionNameChanged;
public event EventHandler KeyChanged;
public event EventHandler DataTypeChanged;
public event EventHandler ValueChanged;
public event EventHandler IsDeletedChanged;
public event EventHandler IsSynchronizedChanged;
public event EventHandler MachineChanged;
protected String _machineguid;
///
/// Gets or sets the datastoreitembase machine guid.
///
[Column("MACHINE_GUID")]
[ForeignKey("Machine")]
public String MachineGuid
{
get
{
return _machineguid;
}
set
{
if (_machineguid != value)
{
_machineguid = value;
}
}
}
protected String _collectionname;
///
/// Gets or sets the datastoreitembase collection name.
///
[Column("COLLECTION_NAME")]
public String CollectionName
{
get
{
return _collectionname;
}
set
{
if (_collectionname != value)
{
_collectionname = value;
OnCollectionNameChanged(value);
}
}
}
protected String _key;
///
/// Gets or sets the datastoreitembase key.
///
[Column("KEY")]
public String Key
{
get
{
return _key;
}
set
{
if (_key != value)
{
_key = value;
OnKeyChanged(value);
}
}
}
protected Int32 _datatype;
///
/// Gets or sets the datastoreitembase data type.
///
[Column("DATA_TYPE")]
public Int32 DataType
{
get
{
return _datatype;
}
set
{
if (_datatype != value)
{
_datatype = value;
OnDataTypeChanged(value);
}
}
}
protected Byte[] _value;
///
/// Gets or sets the datastoreitembase value.
///
[Column("VALUE")]
public Byte[] Value
{
get
{
return _value;
}
set
{
if (_value != value)
{
_value = value;
OnValueChanged(value);
}
}
}
protected Boolean _isdeleted;
///
/// Gets or sets the datastoreitembase is deleted.
///
[Column("IS_DELETED")]
public Boolean IsDeleted
{
get
{
return _isdeleted;
}
set
{
if (_isdeleted != value)
{
_isdeleted = value;
OnIsDeletedChanged(value);
}
}
}
protected Boolean _issynchronized;
///
/// Gets or sets the datastoreitembase is synchronized.
///
[Column("IS_SYNCHRONIZED")]
public Boolean IsSynchronized
{
get
{
return _issynchronized;
}
set
{
if (_issynchronized != value)
{
_issynchronized = value;
OnIsSynchronizedChanged(value);
}
}
}
protected Machine _machine;
///
/// Gets or sets the datastoreitembase machine.
///
[XmlIgnore]
[JsonIgnore]
public virtual Machine Machine
{
get
{
return _machine;
}
set
{
if (_machine != value)
{
_machine = value;
if (Machine != null)
{
MachineGuid = Machine.Guid;
}
OnMachineChanged(value);
}
}
}
///
/// Called when the CollectionName has changed.
///
protected virtual void OnCollectionNameChanged(String collectionname)
{
CollectionNameChanged?.Invoke(this, collectionname);
RaisePropertyChanged(nameof(CollectionName));
}
///
/// Called when the Key has changed.
///
protected virtual void OnKeyChanged(String key)
{
KeyChanged?.Invoke(this, key);
RaisePropertyChanged(nameof(Key));
}
///
/// Called when the DataType has changed.
///
protected virtual void OnDataTypeChanged(Int32 datatype)
{
DataTypeChanged?.Invoke(this, datatype);
RaisePropertyChanged(nameof(DataType));
}
///
/// Called when the Value has changed.
///
protected virtual void OnValueChanged(Byte[] value)
{
ValueChanged?.Invoke(this, value);
RaisePropertyChanged(nameof(Value));
}
///
/// Called when the IsDeleted has changed.
///
protected virtual void OnIsDeletedChanged(Boolean isdeleted)
{
IsDeletedChanged?.Invoke(this, isdeleted);
RaisePropertyChanged(nameof(IsDeleted));
}
///
/// Called when the IsSynchronized has changed.
///
protected virtual void OnIsSynchronizedChanged(Boolean issynchronized)
{
IsSynchronizedChanged?.Invoke(this, issynchronized);
RaisePropertyChanged(nameof(IsSynchronized));
}
///
/// Called when the Machine has changed.
///
protected virtual void OnMachineChanged(Machine machine)
{
MachineChanged?.Invoke(this, machine);
RaisePropertyChanged(nameof(Machine));
}
///
/// Initializes a new instance of the class.
///
public DataStoreItemBase() : base()
{
}
}
}