Пример #1
0
        private int SetterImpl(IntPtr thisPtr, IntPtr dataPtr, int dataSize)
        {
            if (dataPtr == IntPtr.Zero)
            {
                return(Result.Ok.Code);
            }

            var callback = CppObjectShadow.ToCallback <ID2D1EffectImpl>(thisPtr);

            var value = Marshal.PtrToStructure <U>(dataPtr);

            PropertyInfo.SetValue(callback, value);

            return(Result.Ok.Code);
        }
Пример #2
0
        private int GetterImpl(IntPtr thisPtr, IntPtr dataPtr, int datasize, out int actualSize)
        {
            actualSize = Marshal.SizeOf <U>();
            if (dataPtr == IntPtr.Zero)
            {
                return(Result.Ok.Code);
            }

            var callback = CppObjectShadow.ToCallback <ID2D1EffectImpl>(thisPtr);

            var value = (U)PropertyInfo.GetValue(callback);

            Marshal.StructureToPtr(value, dataPtr, true);

            return(Result.Ok.Code);
        }
    private static unsafe partial int OnIntegerValueChangedImpl_(IntPtr thisObject, void *_storyboard, void *_variable, void *_newValue, void *_previousValue, int _cDimension)
    {
        IUIAnimationVariableIntegerChangeHandler2 @this = CppObjectShadow.ToCallback <IUIAnimationVariableIntegerChangeHandler2>(thisObject);

        try
        {
            Span <int> newValue      = new int[_cDimension];
            Span <int> previousValue = new int[_cDimension];
            new Span <int>(_newValue, newValue.Length).CopyTo(newValue);
            new Span <int>(_previousValue, previousValue.Length).CopyTo(previousValue);
            IUIAnimationStoryboard2 storyboard = new((IntPtr)_storyboard);
            IUIAnimationVariable2   variable   = new((IntPtr)_variable);
            @this.OnValueChanged(storyboard, variable, newValue, previousValue, _cDimension);
            return(Result.Ok.Code);
        }
        catch (Exception __exception__)
        {
            (@this as IExceptionCallback)?.RaiseException(__exception__);
            return(Result.GetResultFromException(__exception__).Code);
        }
    }
Пример #4
0
 private static int DecrementImpl(IntPtr thisObj, int param) =>
 CppObjectShadow.ToCallback <ICallback>(thisObj).Increment(param);