コード例 #1
0
        /// <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 (components != null)
                {
                    components.Dispose();
                }

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

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

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

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

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

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

                if (Factory2D != null)
                {
                    Factory2D.Dispose();
                }
            }
            base.Dispose(disposing);
        }
コード例 #2
0
        public void Dispose()
        {
            this.faceCamera.Stop();

            // Release all resources
            drawingStateBlock.Dispose();
            renderTargetView.Dispose();
            d2dRenderTarget.Dispose();
            backBuffer.Dispose();
            device.ImmediateContext.ClearState();
            device.ImmediateContext.Flush();
            device.Dispose();
            device.Dispose();
            swapChain.Dispose();
            d2dFactory.Dispose();
            dwFactory.Dispose();
            SceneColorBrush.Dispose();
            TextFormat.Dispose();
            drawingStateBlock.Dispose();
            facePointGeometry.Dispose();
            facePointBrush.Dispose();
        }