Example #1
0
            private unsafe static int DrawStrikethroughImpl(IntPtr thisObject, IntPtr clientDrawingContextPtr, float baselineOriginX, float baselineOriginY, Strikethrough.__Native *strikethrough, IntPtr clientDrawingEffectPtr)
            {
                unsafe
                {
                    var shadow   = ToShadow <TextRendererShadow>(thisObject);
                    var callback = (TextRenderer)shadow.Callback;

                    var strikethroughData = new Strikethrough();
                    strikethroughData.__MarshalFrom(ref *strikethrough);
                    return(callback.DrawStrikethrough(GCHandle.FromIntPtr(clientDrawingContextPtr).Target, baselineOriginX, baselineOriginY, ref strikethroughData, (ComObject)Utilities.GetObjectForIUnknown(clientDrawingEffectPtr)).Code);
                }
            }
Example #2
0
            private static unsafe int DrawStrikethrough(IntPtr thisObject, IntPtr clientDrawingContext, float baselineOriginX, float baselineOriginY, GlyphOrientationAngle orientationAngle, Strikethrough.__Native *strikethroughNative, IntPtr clientDrawingEffectPtr)
            {
                try
                {
                    var shadow   = ToShadow <IDWriteTextRenderer1Shadow>(thisObject);
                    var callback = (IDWriteTextRenderer1)shadow.Callback;

                    Strikethrough strikethrough = default;
                    strikethrough.__MarshalFrom(ref *strikethroughNative);

                    var clientDrawingEffect = clientDrawingEffectPtr == IntPtr.Zero ? null : new ComObject(clientDrawingEffectPtr);

                    callback.DrawStrikethrough(clientDrawingContext, baselineOriginX, baselineOriginY, orientationAngle, ref strikethrough, clientDrawingEffect);
                    return(Result.Ok.Code);
                }
                catch (Exception ex)
                {
                    return(Result.GetResultFromException(ex).Code);
                }
            }
            private static unsafe int DrawStrikethroughImpl(IntPtr thisObject, IntPtr clientDrawingContextPtr, float baselineOriginX, float baselineOriginY, Strikethrough.__Native *strikethroughNative, IntPtr clientDrawingEffectPtr)
            {
                try
                {
                    IDWriteTextRendererShadow shadow   = ToShadow <IDWriteTextRendererShadow>(thisObject);
                    IDWriteTextRenderer       callback = (IDWriteTextRenderer)shadow.Callback;

                    var strikethrough = new Strikethrough();
                    strikethrough.__MarshalFrom(ref *strikethroughNative);
                    callback.DrawStrikethrough(clientDrawingContextPtr,
                                               baselineOriginX,
                                               baselineOriginY,
                                               ref strikethrough,
                                               clientDrawingEffectPtr == IntPtr.Zero ? null : (IUnknown)Marshal.GetObjectForIUnknown(clientDrawingEffectPtr));
                    return(Result.Ok.Code);
                }
                catch (Exception ex)
                {
                    return(Result.GetResultFromException(ex).Code);
                }
            }
Example #4
0
            private unsafe static int DrawStrikethroughImpl(IntPtr thisObject, IntPtr clientDrawingContextPtr, float baselineOriginX, float baselineOriginY, Strikethrough.__Native* strikethrough, IntPtr clientDrawingEffectPtr)
            {
                unsafe
                {
                    var shadow = ToShadow<TextRendererShadow>(thisObject);
                    var callback = (TextRenderer)shadow.Callback;

                    var strikethroughData = new Strikethrough();
                    strikethroughData.__MarshalFrom(ref *strikethrough);
                    return callback.DrawStrikethrough(GCHandle.FromIntPtr(clientDrawingContextPtr).Target, baselineOriginX, baselineOriginY, ref strikethroughData, (ComObject)Utilities.GetObjectForIUnknown(clientDrawingEffectPtr)).Code;
                }
            }