コード例 #1
0
ファイル: ImageLoader.cs プロジェクト: medalionk/simple-share
        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;
                }
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        public void Dispose()
        {
            _acrylicVisual.Dispose();
            _noiseSurfaceBrush.Dispose();

            _canvasDevice.Dispose();
            _compositionGraphicsDevice.Dispose();
        }
コード例 #4
0
 private void BubbleView_Unloaded(object sender, RoutedEventArgs e)
 {
     ClearBubbles();
     _BubblesVisual?.Dispose();
     _BubblesVisual = null;
     _canvasDevice  = null;
     _graphicsDevice?.Dispose();
     _graphicsDevice = null;
 }
コード例 #5
0
        public new void Dispose()
        {
            base.Dispose();

            acrylicVisual.Dispose();
            noiseSurfaceBrush.Dispose();

            canvasDevice.Dispose();
            compositionGraphicsDevice.Dispose();
        }
コード例 #6
0
        void OnUnloaded(object sender, RoutedEventArgs e)
        {
            Unloaded -= OnUnloaded;
            Loading  -= OnLoading;

            _device?.Dispose();
            _device = null;

            _graphdevice?.Dispose();
            _graphdevice = null;

            _drawsurface?.Dispose();
            _drawsurface = null;
        }
コード例 #7
0
        static public void Uninitialize()
        {
            _compositor = null;

            if (_compositionDevice != null)
            {
                _compositionDevice.Dispose();
                _compositionDevice = null;
            }

            if (_canvasDevice != null)
            {
                _canvasDevice.Dispose();
                _canvasDevice = null;
            }

            _intialized = false;
        }
コード例 #8
0
ファイル: ImageLoader.cs プロジェクト: SumonRayy/Feels
        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;
                }
            }
        }
コード例 #9
0
 public void Dispose()
 {
     _drawingBrush.Dispose();
     _drawingSurface.Dispose();
     _graphicsDevice.Dispose();
 }