private bool TickCreateNewCanvas() { if (_incomingCanvas != null) { ArgNewPictureBox arg = _incomingCanvas; _incomingCanvas = null; _canvas.Clear(); lock (_npbSync){ _newPB.Clear(); _clientServerPictureBoxID.Clear(); } lock (_astSync){ _argsSendToAllClients.Clear(); _argsSendToAllClients = null; } PictureBoxObj pb = new PictureBoxObj(arg.ClientID, 0, PictureBoxStatus.Canvas); pb.BorderStyle = BorderStyle.FixedSingle; pb.Width = arg.PBImage.Width; pb.Height = arg.PBImage.Height; pb.Image = arg.PBImage; _canvas.SetCanvas(pb); AppLogger.Log("New canvas created by " + arg.ClientID); lock (_astSync) { _argsSendToAllClients = new List <ICommandArg>(); } return(true); } return(false); }
public void Clear() { if (_isCleared) { return; } _isCleared = true; _needUpdateFrontPicture = true; _toRemovePB.Clear(); _toApplyPB.Clear(); PictureBoxObj[] pbs = _drawObjects.GetValues(); for (int i = 0; i < pbs.Length; i++) { RemovePictureObj(pbs[i].UniqueID); } _drawObjects.Clear(); this.Controls.Remove(_backPicture); this.Controls.Remove(_frontPicture); CanvasClearEvent?.Invoke(this, null); _backPicture.Dispose(); _frontPicture.Dispose(); }
public void Clear() { Stop(); ResetEvent?.Invoke(this, null); IBTNode[] allNodes = _treeNodes.GetValues(); for (int i = 0; i < allNodes.Length; i++) { IBTNode cNode = allNodes[i]; if (cNode != null) { cNode.NodeErrorEvent -= OnNodeErrorMessageHandler; this.ResetEvent -= cNode.Reset; } } _treeNodes.Clear(); }