private void SendDataModelLoop() { if (ConfigClass.IsOperator && LayoutManager.Instance.TcpConnection != null) { DataModelChangeCommand command = new DataModelChangeCommand(DataModel.Instance.Elements); LayoutManager.Instance.TcpConnection.Send(command); } Thread.Sleep(Settings.Default.ClientUpdateIntervall); }
/// <summary> /// This method is called by the LayoutManager, if the tcp connection received a DataModelChangeCommand. /// </summary> /// <param name="data"></param> public void TcpConnection_newDataReceived(object data) { if (data.GetType() == typeof(DataModelChangeCommand)) { DataModelChangeCommand command = (DataModelChangeCommand)data; if (command.CommandType == DataModelCommand.UPDATE_ELEMENTS) { this.UpdateDataModelElements(command.GetElements()); // Now show the ui, if it is shown grayed. DataModel.Instance.ShowUI = true; } } }