public D2D1DrawingStateBlock CreateDrawingStateBlock(D2D1DrawingStateDescription drawingStateDescription, DWriteRenderingParams textRenderingParams)
        {
            ID2D1DrawingStateBlock drawingStateBlock;

            GCHandle drawingStateDescriptionHandle = GCHandle.Alloc(drawingStateDescription, GCHandleType.Pinned);

            try
            {
                this.factory.CreateDrawingStateBlock(drawingStateDescriptionHandle.AddrOfPinnedObject(), textRenderingParams == null ? null : (IDWriteRenderingParams)textRenderingParams.Handle, out drawingStateBlock);
            }
            finally
            {
                drawingStateDescriptionHandle.Free();
            }

            return new D2D1DrawingStateBlock(drawingStateBlock);
        }
        public D2D1DrawingStateBlock CreateDrawingStateBlock(D2D1DrawingStateDescription drawingStateDescription)
        {
            ID2D1DrawingStateBlock drawingStateBlock;

            GCHandle drawingStateDescriptionHandle = GCHandle.Alloc(drawingStateDescription, GCHandleType.Pinned);

            try
            {
                this.factory.CreateDrawingStateBlock(drawingStateDescriptionHandle.AddrOfPinnedObject(), null, out drawingStateBlock);
            }
            finally
            {
                drawingStateDescriptionHandle.Free();
            }

            return new D2D1DrawingStateBlock(drawingStateBlock);
        }