Exemple #1
0
        static T GetMethodDelegate <T>(UnmanagedLibrary library)
            where T : class
        {
            var methodName = RemoveStringSuffix(typeof(T).Name, "_delegate");

            return(library.GetNativeMethodDelegate <T>(methodName));
        }
Exemple #2
0
 public NativeMethods(UnmanagedLibrary library)
 {
     this.VLFD_ProgramFPGA_init        = GetMethodDelegate <Delegates.VLFD_ProgramFPGA_delegate>(library);
     this.VLFD_AppOpen_init            = GetMethodDelegate <Delegates.VLFD_AppOpen_delegate>(library);
     this.VLFD_IO_Open_init            = GetMethodDelegate <Delegates.VLFD_IO_Open_delegate>(library);
     this.VLFD_AppFIFOReadData_init    = GetMethodDelegate <Delegates.VLFD_AppFIFOReadData_delegate>(library);
     this.VLFD_AppFIFOWriteData_init   = GetMethodDelegate <Delegates.VLFD_AppFIFOWriteData_delegate>(library);
     this.VLFD_IO_WriteReadData_init   = GetMethodDelegate <Delegates.VLFD_IO_WriteReadData_delegate>(library);
     this.VLFD_AppChannelSelector_init = GetMethodDelegate <Delegates.VLFD_AppChannelSelector_delegate>(library);
     this.VLFD_AppClose_init           = GetMethodDelegate <Delegates.VLFD_AppClose_delegate>(library);
     this.VLFD_IO_Close_init           = GetMethodDelegate <Delegates.VLFD_IO_Close_delegate>(library);
     this.VLFD_GetLastErrorMsg_init    = GetMethodDelegate <Delegates.VLFD_GetLastErrorMsg_delegate>(library);
 }