示例#1
0
        public void RemovePictureObj(long picID)
        {
            lock (_canvasSync)
            {
                PictureBoxObj pic;
                _drawObjects.TryGetValue(picID, out pic);
                _drawObjects.Remove(picID);
                if (pic == null)
                {
                    return;
                }

                _backPicture.Controls.Remove(pic);
                pic.Dispose();
                RemoveDrawObjectList(picID);
                _needUpdateFrontPicture = true;
            }
        }
示例#2
0
        private void RemoveDrawObjectList(long picObjID)
        {
            DrawObjectList drl = null;

            lock (_canvasSync)
            {
                _editPBDrawObjects.TryGetValue(picObjID, out drl);
                _editPBDrawObjects.Remove(picObjID);
            }
            if (drl != null)
            {
                drl.Clear();
            }
        }
示例#3
0
        public void OnConnectorDisconnectHandler(object sender, object disconnectionState)
        {
            IConnector connector = sender as IConnector;

            if (connector == null)
            {
                return;
            }

            connector.DisconnectEvent  -= OnConnectorDisconnectHandler;
            connector.ReceiveAction    -= OnReceveDataHandler;
            connector.ReceiveComAction -= OnReceiveCommandHandler;

            lock (_cSync) {
                _connectors.Remove(connector.UniqueID);
            }

            NetLogger.Log(connector.UniqueID + " disconneted. " +
                          (disconnectionState == null ? "" : disconnectionState.ToString()));

            DisconnectEvent?.Invoke(connector, disconnectionState);
        }