aboutsummaryrefslogblamecommitdiff
path: root/ARMeilleure/Translation/DelegateInfo.cs
blob: 36320ac31752a16d4a2a8e8ed9b54a47ddb3990c (plain) (tree)
1
2
3
4
5
6



                                     
                      











                                                                                                   
using System;
using System.Runtime.InteropServices;

namespace ARMeilleure.Translation
{
    class DelegateInfo
    {
        private readonly Delegate _dlg; // Ensure that this delegate will not be garbage collected.

        public IntPtr FuncPtr { get; }

        public DelegateInfo(Delegate dlg)
        {
            _dlg = dlg;

            FuncPtr = Marshal.GetFunctionPointerForDelegate<Delegate>(dlg);
        }
    }
}