예제 #1
0
파일: DvDevice.cs 프로젝트: fuzzy01/ohNet
        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);
        }
예제 #2
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);
 }
예제 #3
0
파일: DvDevice.cs 프로젝트: Wodath/ohNet
        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;
        }
예제 #4
0
파일: DvDevice.cs 프로젝트: wifigeek/ohNet
 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);
 }