コード例 #1
0
        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);
        }
コード例 #2
0
        /// <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;
                }
            }
        }