public void Dispose() { lock (_drawingLock) { _compositor = null; DisplayInformation.DisplayContentsInvalidated -= OnDisplayContentsInvalidated; if (_canvasDevice != null) { _canvasDevice.DeviceLost -= DeviceLost; // // Only dispose the canvas device if we own the device. // if (_isDeviceCreator) { _canvasDevice.Dispose(); } _canvasDevice = null; } if (_graphicsDevice != null) { _graphicsDevice.RenderingDeviceReplaced -= RenderingDeviceReplaced; // // Only dispose the composition graphics device if we own the device. // if (_isDeviceCreator) { _graphicsDevice.Dispose(); } _graphicsDevice = null; } } }
protected override void OnDisconnected() { if (CompositionBrush != null) { IsConnected = false; canvasDevice.Dispose(); canvasDevice = null; graphicsDevice.Dispose(); graphicsDevice = null; surfaceBrush1.Dispose(); surfaceBrush1 = null; surfaceBrush2.Dispose(); surfaceBrush2 = null; surface1.Dispose(); surface1 = null; surface2.Dispose(); surface2 = null; Source1Animation.Dispose(); Source1Animation = null; Source2Animation.Dispose(); Source2Animation = null; colorBrush1.Dispose(); colorBrush1 = null; colorBrush2.Dispose(); colorBrush2 = null; CompositionBrush.Dispose(); CompositionBrush = null; } }
public void Dispose() { _acrylicVisual.Dispose(); _noiseSurfaceBrush.Dispose(); _canvasDevice.Dispose(); _compositionGraphicsDevice.Dispose(); }
private void BubbleView_Unloaded(object sender, RoutedEventArgs e) { ClearBubbles(); _BubblesVisual?.Dispose(); _BubblesVisual = null; _canvasDevice = null; _graphicsDevice?.Dispose(); _graphicsDevice = null; }
public new void Dispose() { base.Dispose(); acrylicVisual.Dispose(); noiseSurfaceBrush.Dispose(); canvasDevice.Dispose(); compositionGraphicsDevice.Dispose(); }
void OnUnloaded(object sender, RoutedEventArgs e) { Unloaded -= OnUnloaded; Loading -= OnLoading; _device?.Dispose(); _device = null; _graphdevice?.Dispose(); _graphdevice = null; _drawsurface?.Dispose(); _drawsurface = null; }
static public void Uninitialize() { _compositor = null; if (_compositionDevice != null) { _compositionDevice.Dispose(); _compositionDevice = null; } if (_canvasDevice != null) { _canvasDevice.Dispose(); _canvasDevice = null; } _intialized = false; }
public void Dispose() { lock (_drawingLock) { _compositor = null; if (_canvasDevice != null) { _canvasDevice.DeviceLost -= DeviceLost; _canvasDevice.Dispose(); _canvasDevice = null; } if (_graphicsDevice != null) { _graphicsDevice.RenderingDeviceReplaced -= RenderingDeviceReplaced; _graphicsDevice.Dispose(); _graphicsDevice = null; } } }
public void Dispose() { _drawingBrush.Dispose(); _drawingSurface.Dispose(); _graphicsDevice.Dispose(); }