SafeDispatch/Safedispatch_4_0/maptab/Radio/Subscriber.cs

188 lines
4.7 KiB
C#
Raw Permalink Normal View History

2024-02-22 16:43:59 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Safedispatch_4_0.Radio
{
public enum SubscriberType { DISPATCHER, GROUP, ALL, SUBSCRIBER, MANUAL, UNKNOWN };
public class Subscriber : INotifyPropertyChanged
{
private void NotifyPropertyChanged(string propertyName)
{
//Raise PropertyChanged event
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public event PropertyChangedEventHandler PropertyChanged;
private object _lock = new object();
private Int32 nrOfUpdates;
public Int32 NrOfUpdates
{
get { return nrOfUpdates; }
set
{
lock (_lock)
{
//The property changed event will get fired whenever
//the value changes. The subscriber will do work if the value is
//1. This way you can keep your business logic outside of the setter
if (value != nrOfUpdates)
{
nrOfUpdates = value;
NotifyPropertyChanged("nrOfUpdates");
}
}
}
}
public String ImageKey { get; set; }
private String _dispatcherName;
public String DispatcherName
{
get { return _dispatcherName; }
set { this._dispatcherName = value; }
}
private Boolean _online;
public Boolean Online
{
get { return _online; }
set { this._online = value; }
}
private Boolean _isEmergency;
public Boolean IsEmergency
{
get { return _isEmergency; }
set { this._isEmergency = value; }
}
private String _iconFilePath;
public String IconFilePath
{
get { return _iconFilePath; }
set { _iconFilePath = value; }
}
private SubscriberType _type;
public SubscriberType SubscriberType
{
get { return _type; }
set { this._type = value; }
}
private String _typeRegion;
public String SubscriberTypeRegion
{
get { return _typeRegion; }
set { this._typeRegion = value; }
}
private Int32 _id;
public Int32 Id
{
get { return _id; }
set { _id = value; }
}
private Int32 _sc_id;
public Int32 Sc_id
{
get { return _sc_id; }
set { _sc_id = value; }
}
private String _imei;
public String Imei
{
get { return _imei; }
set { _imei = value; }
}
private String _gw_and_radioID;
public String Gw_and_radioID
{
get { return _gw_and_radioID; }
set { _gw_and_radioID = value; }
}
private String gatewayName = "";
public String GatewayName
{
get { return gatewayName; }
set { gatewayName = value; }
}
private Boolean _isFavorite;
public Boolean Favorite
{
get { return _isFavorite; }
set { this._isFavorite = value; }
}
private String _ip;
public String IP
{
get { return _ip; }
set { this._ip = value; }
}
private Boolean _hasRemoteMonitor;
public Boolean HasRemoteMonitor
{
get { return _hasRemoteMonitor; }
set { this._hasRemoteMonitor = value; }
}
private Boolean _hasTextMessage;
public Boolean HasTextMessage
{
get { return _hasTextMessage; }
set { this._hasTextMessage = value; }
}
private Boolean _canMakeSipCalls;
public Boolean canMakeSipCalls
{
get { return _canMakeSipCalls; }
set { this._canMakeSipCalls = value; }
}
private int _sipID;
public int SipID
{
get { return _sipID; }
set { this._sipID = value; }
}
public Subscriber()
{
this.ImageKey = "i_manual_dial";
this.DispatcherName = "Unknown";
this.Online = true;
this.Favorite = false;
this._hasRemoteMonitor = false;
this._hasTextMessage = true;
this.Id = 0;
this.Sc_id = 0;
this.Imei = "";
this.IP = "";
this.SubscriberType = SubscriberType.UNKNOWN;
}
}
}