public PictureBoxObj GetEditablePictureBox(long controlID) { lock (_canvasSync) { PictureBoxObj c; _drawObjects.TryGetValue(controlID, out c); return(c); } }
public void AddDrawObject(long picID, DrawObject drawObj) { if (IsCleared || drawObj == null) { return; } lock (_canvasSync) { DrawObjectList drl; _editPBDrawObjects.TryGetValue(picID, out drl); if (drl != null) { drl.AddDrawObject(drawObj); } } }
public IConnector GetConnector(long connectionID) { lock (_cSync) { IConnector con = null; _connectors.TryGetValue(connectionID, out con); return(con); } }
private long GetPictureBoxAssociationID(long picID) { lock (_npbSync) { long serverID = 0; _clientServerPictureBoxID.TryGetValue(picID, out serverID); return(serverID); } }
public TeamPainterTCPClient GetClientByConnectionID(long connectionID) { long clientID = 0; lock (_cSync) { _clientConnectionAssociation.TryGetValue(connectionID, out clientID); TeamPainterTCPClient tp; _clients.TryGetValue(clientID, out tp); return(tp); } }
public bool AddClient(TeamPainterTCPClient client) { if (client == null || client.Connector == null) { return(false); } long connectionID = client.Connector.UniqueID; lock (_cSync) { TeamPainterTCPClient regcl; _clients.TryGetValue(client.UniqueID, out regcl); if (regcl != null) { NetLogger.Log("This client is already exist"); return(false); } if (_clients.Count >= _maxClients) { NetLogger.Log("Max connection"); return(false); } _clientConnectionAssociation[connectionID] = client.UniqueID; _clients[client.UniqueID] = client; client.Connector.DisconnectEvent += OnConnectorDisconnectHandler; client.Connector.ReceiveAction = null; client.Connector.ReceiveAction += OnReceveDataHandler; client.Connector.ReceiveComAction = null; client.Connector.ReceiveComAction += OnReceiveCommandHandler; return(true); } }