private static int WriteResource(IntPtr aUserData, IntPtr aUriTail, uint aInterface, IntPtr aLanguageList, IntPtr aWriterData, CallbackWriteResourceBegin aWriteBegin, CallbackWriteResource aWriteResource, CallbackWriteResourceEnd aWriteEnd) { GCHandle gch = GCHandle.FromIntPtr(aUserData); DvDeviceStandard self = (DvDeviceStandard)gch.Target; string uriTail = InteropUtils.PtrToStringUtf8(aUriTail); List <string> languageList = new List <string>(); uint count = DvResourceWriterLanguageCount(aLanguageList); for (uint i = 0; i < count; i++) { languageList.Add(InteropUtils.PtrToStringUtf8(DvResourceWriterLanguage(aLanguageList, i))); } ResourceWriter writer = new ResourceWriter(aWriterData, aWriteBegin, aWriteResource, aWriteEnd); try { writer.Write(self.iResourceManager, uriTail, aInterface, languageList); } catch { return(-1); } return(0); }
private static unsafe void WriteResource(IntPtr aUserData, char *aUriTail, uint aInterface, IntPtr aWriterData, CallbackWriteResourceBegin aWriteBegin, CallbackWriteResource aWriteResource, CallbackWriteResourceEnd aWriteEnd) { GCHandle gch = GCHandle.FromIntPtr(aUserData); DvDevice self = (DvDevice)gch.Target; string uriTail = Marshal.PtrToStringAnsi((IntPtr)aUriTail); ResourceWriter writer = new ResourceWriter(self.iResourceManager, uriTail, aInterface, aWriterData, aWriteBegin, aWriteResource, aWriteEnd); }
private static int WriteResource(IntPtr aUserData, IntPtr aUriTail, uint aInterface, IntPtr aLanguageList, IntPtr aWriterData, CallbackWriteResourceBegin aWriteBegin, CallbackWriteResource aWriteResource, CallbackWriteResourceEnd aWriteEnd) { GCHandle gch = GCHandle.FromIntPtr(aUserData); DvDeviceStandard self = (DvDeviceStandard)gch.Target; string uriTail = InteropUtils.PtrToStringUtf8(aUriTail); List<string> languageList = new List<string>(); uint count = DvResourceWriterLanguageCount(aLanguageList); for (uint i = 0; i < count; i++) { languageList.Add(InteropUtils.PtrToStringUtf8(DvResourceWriterLanguage(aLanguageList, i))); } ResourceWriter writer = new ResourceWriter(aWriterData, aWriteBegin, aWriteResource, aWriteEnd); try { writer.Write(self.iResourceManager, uriTail, aInterface, languageList); } catch { return -1; } return 0; }
private static unsafe void WriteResource(IntPtr aUserData, char* aUriTail, uint aInterface, IntPtr aLanguageList, IntPtr aWriterData, CallbackWriteResourceBegin aWriteBegin, CallbackWriteResource aWriteResource, CallbackWriteResourceEnd aWriteEnd) { GCHandle gch = GCHandle.FromIntPtr(aUserData); DvDeviceStandard self = (DvDeviceStandard)gch.Target; string uriTail = Marshal.PtrToStringAnsi((IntPtr)aUriTail); List<string> languageList = new List<string>(); uint count = DvResourceWriterLanguageCount(aLanguageList); for (uint i = 0; i < count; i++) { languageList.Add(Marshal.PtrToStringAnsi(DvResourceWriterLanguage(aLanguageList, i))); } ResourceWriter writer = new ResourceWriter(aWriterData, aWriteBegin, aWriteResource, aWriteEnd); writer.Write(self.iResourceManager, uriTail, aInterface, languageList); }