コード例 #1
0
        internal static T GetDelegateFor <T>(string name) where T : class
        {
            Type     delegateType = typeof(T);
            IntPtr   proc         = XWGL.GetProcAddress(name);
            Delegate del          = Marshal.GetDelegateForFunctionPointer(proc, delegateType);

            return(del as T);
        }
コード例 #2
0
ファイル: GL42.cs プロジェクト: HugoPeters1024/Arqan
        private static T GetDelegateFor <T>() where T : class
        {
            Type     delegateType = typeof(T);
            string   name         = delegateType.Name.Replace("Delegate", "");
            IntPtr   proc         = XWGL.GetProcAddress(name);
            Delegate del          = Marshal.GetDelegateForFunctionPointer(proc, delegateType);

            return(del as T);
        }