/// <summary> /// imageWebModel constructor /// </summary> public ImageWebModel() { clientTcpConnectionWeb singelton = clientTcpConnectionWeb.Instance; string serviceConnect = singelton.IsServiceConnect(); Status = serviceConnect; if (serviceConnect.Equals("Connect")) { singelton.MessageReceived += getConfig; DataInfo msg = new DataInfo(CommandEnum.GetConfigCommand, null); singelton.WriteToServer(msg.toJson()); Students = getStudents(); count++; } }
/// <summary> /// Constructor /// </summary> public PhotoModel() { clientTcpConnectionWeb singelton = clientTcpConnectionWeb.Instance; string serviceConnect = singelton.IsServiceConnect(); numOfPic = 0; if (serviceConnect.Equals("Connect")) { singelton.MessageReceived += getConfig; DataInfo msg = new DataInfo(CommandEnum.GetConfigCommand, null); singelton.WriteToServer(msg.toJson()); Photos = new List <PhotoWeb>(); getListPhotos(); count++; } }
/// <summary> /// constructor of log model /// </summary> public LogModel() { clientTcpConnectionWeb singelton = clientTcpConnectionWeb.Instance; string serviceConnect = singelton.IsServiceConnect(); ifLogUpdate = false; if (serviceConnect.Equals("Connect")) { Logs = new List <LogWeb>(); singelton.MessageReceived += getlogs; DataInfo msg = new DataInfo(CommandEnum.LogCommand, null); singelton.WriteToServer(msg.toJson()); while (!ifLogUpdate) { Thread.Sleep(100); } } }
/// <summary> /// constructor of config model /// </summary> public ConfigModel() { clientTcpConnectionWeb singelton = clientTcpConnectionWeb.Instance; string serviceConnect = singelton.IsServiceConnect(); ifConfUpdate = false; if (serviceConnect.Equals("Connect")) { Handlers = new ObservableCollection <string>(); singelton.MessageReceived += getConf; DataInfo msg = new DataInfo(CommandEnum.GetConfigCommand, null); singelton.WriteToServer(msg.toJson()); while (!ifConfUpdate) { Thread.Sleep(100); } } }