public void Destroy() { _destroyed = true; if (_eventMediator != null) { _eventMediator.UnregisterEventHandler(ServerEntity.Identifier); _eventMediator.TileHasCaptureChanged -= EventBrokerTileHasCaptureChanged; _eventMediator = null; } if (_menu != null) { _menu.Dispose(); _menu = null; } if (_fpsPublisher != null) { _fpsPublisher.Dispose(); _fpsPublisher = null; } StopMouseMoveTimer(); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { if (_parentForm != null) { _parentForm.Move -= OnParentMoved; _parentForm = null; } if (_component != null) { _component.Closing -= OnComponentClosing; _component = null; } if (_delayedEventPublisher != null) { _delayedEventPublisher.Dispose(); _delayedEventPublisher = null; } if (_physicalWorkspace != null) { _physicalWorkspace.Drawing -= OnPhysicalWorkspaceDrawing; _physicalWorkspace.LayoutCompleted -= OnLayoutCompleted; _physicalWorkspace.ScreenRectangleChanged -= OnScreenRectangleChanged; _physicalWorkspace = null; } } base.Dispose(disposing); }
public void Dispose() { if (_scrollbarEventPublisher != null) { _scrollbarEventPublisher.Dispose(); _scrollbarEventPublisher = null; } _eventMediator.TileHasCaptureChanged -= EventBrokerTileHasCaptureChanged; }
public void SetCaptureHandler(TileController tileController, IMouseWheelHandler captureMouseWheelHandler) { if (_captureTileController == tileController && _captureMouseWheelHandler == captureMouseWheelHandler) { return; } if (_captureMouseWheelHandler != null) { if (_delayedStop != null) { _delayedStop.Dispose(); _delayedStop = null; } EventsHelper.Fire(tileController._wheelCaptureChangingEvent, tileController, new ItemEventArgs <IMouseWheelHandler>(null)); _captureMouseWheelHandler.StopWheel(); _captureTileController._tile.ImageViewer.EventBroker.OnMouseWheelCaptureChanged(new MouseWheelCaptureChangedEventArgs(_captureTileController._tile, false)); } _captureTileController = tileController; _captureMouseWheelHandler = captureMouseWheelHandler; if (_captureMouseWheelHandler == null) { //This is only needed when the capture mouse wheel handler is not null. _captureTileController = null; if (_delayedStop != null) { _delayedStop.Dispose(); _delayedStop = null; } return; } _delayedStop = new DelayedEventPublisher((s, e) => SetCaptureHandler(tileController, null), WheelStopDelayMilliseconds); EventsHelper.Fire(tileController._wheelCaptureChangingEvent, tileController, new ItemEventArgs <IMouseWheelHandler>(_captureMouseWheelHandler)); _captureMouseWheelHandler.StartWheel(); _captureTileController._tile.ImageViewer.EventBroker.OnMouseWheelCaptureChanged(new MouseWheelCaptureChangedEventArgs(_captureTileController._tile, true)); _delayedStop.Publish(this, EventArgs.Empty); }
public void Dispose() { if (_delayedContextMenuRequestPublisher == null) { return; } ReleaseCapture(true); this.CaptureMouseWheelHandler = null; _delayedContextMenuRequestPublisher.Dispose(); _tile.ContextMenuRequested -= ProcessExplicitContextMenuRequest; _delayedContextMenuRequestPublisher = null; }
protected override void Dispose(bool disposing) { _synchronizationContext = null; if (_publisher != null) { _publisher.Dispose(); _publisher = null; } ImageViewer.EventBroker.DisplaySetChanged -= OnDisplaySetChanged; ImageViewer.EventBroker.ImageDrawing -= OnImageDrawing; base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (disposing) { var asyncFrame = Frame; asyncFrame.AsyncProgressChanged -= OnAsyncProgressChanged; if (_delayedEventPublisher != null) { _delayedEventPublisher.Dispose(); _delayedEventPublisher = null; } } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (_dynamicRenderEventPublisher != null) { _dynamicRenderEventPublisher.Cancel(); _dynamicRenderEventPublisher.Dispose(); _dynamicRenderEventPublisher = null; } if (_vtkRenderWindow != null) { _vtkRenderWindow.Dispose(); _vtkRenderWindow = null; } if (_vtkRenderer != null) { _vtkRenderer.Dispose(); _vtkRenderer = null; } if (_sceneGraphRoot != null) { _sceneGraphRoot.Dispose(); _sceneGraphRoot = null; } if (_imageBuffer != null) { _imageBuffer.Dispose(); _imageBuffer = null; } if (_overlayBuffer != null) { _overlayBuffer.Dispose(); _overlayBuffer = null; } if (_finalBuffer != null) { _finalBuffer.Dispose(); _finalBuffer = null; } } }
public void Dispose(bool disposing) { if (!_disposed) { if (_resizePublisher != null) { if (disposing) _resizePublisher.Dispose(); _resizePublisher = null; } SizeChanged -= OnSizeChanged; DestroyImageBoxViews(); _disposed = true; } }
public override void Stop() { base.Stop(); if (_delaySetFileStoreDirectory != null) { _delaySetFileStoreDirectory.Cancel(); _delaySetFileStoreDirectory.Dispose(); _delaySetFileStoreDirectory = null; } if (_activityMonitor != null) { _activityMonitor.IsConnectedChanged -= ActivityMonitorOnIsConnectedChanged; _activityMonitor.Dispose(); } }
public void Dispose() { _delayedContextMenuRequestPublisher.Dispose(); _tile.ContextMenuRequested -= ProcessExplicitContextMenuRequest; }