/// <summary> /// Dispose /// </summary> public void Dispose() { foreach (var textFormat in TextFormats.Values) { textFormat.Dispose(); } TextFormats.Clear(); Brush?.Dispose(); TextFormat?.Dispose(); TextFormat = null; Brush?.Dispose(); Brush = null; Target?.Dispose(); Target = null; NativeDeviceContext.Target = null; NativeDeviceContext?.Dispose(); NativeDeviceContext = null; NativeDevice?.Dispose(); NativeDevice = null; NativeFactory?.Dispose(); NativeFactory = null; NativeFactoryWrite?.Dispose(); NativeFactoryWrite = null; }
public void Dispose() { Canvas.Dispose(); rasterizerState.Dispose(); blendState.Dispose(); depthStencilState.Dispose(); samplerState.Dispose(); backBufferView.Dispose(); depthStencilView.Dispose(); swapChain.Dispose(); NativeDeviceContext.Dispose(); NativeDevice.Dispose(); }