當前位置: 首頁>>代碼示例>>C#>>正文


C# Mtp.MtpDeviceHandle類代碼示例

本文整理匯總了C#中Mtp.MtpDeviceHandle的典型用法代碼示例。如果您正苦於以下問題:C# MtpDeviceHandle類的具體用法?C# MtpDeviceHandle怎麽用?C# MtpDeviceHandle使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MtpDeviceHandle類屬於Mtp命名空間,在下文中一共展示了MtpDeviceHandle類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CheckErrorStack

        internal static void CheckErrorStack(MtpDeviceHandle handle)
        {
            IntPtr ptr = MtpDevice.GetErrorStack (handle);
            if (ptr == IntPtr.Zero)
                return;

            LibMtpException ex = null;
            while (ptr != IntPtr.Zero) {
                Error e = (Error)Marshal.PtrToStructure (ptr, typeof(Error));
                ex = new LibMtpException (e.errornumber, e.error_text, ex);
                ptr = e.next;
            }

            // Once we throw the exception, clear the error stack
            MtpDevice.ClearErrorStack (handle);
            throw ex;
        }
開發者ID:knocte,項目名稱:banshee,代碼行數:17,代碼來源:Error.cs

示例2: LIBMTP_Get_Friendlyname

 private static extern IntPtr LIBMTP_Get_Friendlyname (MtpDeviceHandle handle); // char *
開發者ID:petejohanson,項目名稱:banshee,代碼行數:1,代碼來源:MtpDevice.cs

示例3: LIBMTP_Get_Folder_List

 private static extern IntPtr LIBMTP_Get_Folder_List (MtpDeviceHandle handle); // LIBMTP_folder_t*
開發者ID:gclark916,項目名稱:banshee,代碼行數:1,代碼來源:Folder.cs

示例4: CreateFolder

 internal static uint CreateFolder (MtpDeviceHandle handle, string name, uint parentId)
 {
     uint result = LIBMTP_Create_Folder (handle, name, parentId, 0);
     if (result == 0)
     {
         LibMtpException.CheckErrorStack(handle);
         throw new LibMtpException(ErrorCode.General, "Could not create folder on the device");
     }
     
     return result;
 }
開發者ID:gclark916,項目名稱:banshee,代碼行數:11,代碼來源:Folder.cs

示例5: LIBMTP_Get_Representative_Sample_Format

 private static extern int LIBMTP_Get_Representative_Sample_Format (MtpDeviceHandle handle, FileType type, IntPtr data_array);
開發者ID:gclark916,項目名稱:banshee,代碼行數:1,代碼來源:File.cs

示例6: LIBMTP_Get_Filemetadata

 private static extern IntPtr LIBMTP_Get_Filemetadata (MtpDeviceHandle handle, uint fileid); // LIBMTP_file_t *
開發者ID:gclark916,項目名稱:banshee,代碼行數:1,代碼來源:File.cs

示例7: LIBMTP_Get_Filelisting

 private static extern IntPtr LIBMTP_Get_Filelisting (MtpDeviceHandle handle); // LIBMTP_file_t *
開發者ID:gclark916,項目名稱:banshee,代碼行數:1,代碼來源:File.cs

示例8: LIBMTP_Create_New_Album

 internal static extern int LIBMTP_Create_New_Album (MtpDeviceHandle handle, ref AlbumStruct album, uint parentId);
開發者ID:petejohanson,項目名稱:banshee,代碼行數:1,代碼來源:Album.cs

示例9: GetTrack

 internal static void GetTrack(MtpDeviceHandle handle, uint trackId, string destPath, ProgressFunction callback, IntPtr data)
 {
     if (LIBMTP_Get_Track_To_File (handle, trackId, destPath, callback, data) != 0)
     {
         LibMtpException.CheckErrorStack (handle);
         throw new LibMtpException (ErrorCode.General, "Could not download track from the device");
     }
 }
開發者ID:ptrimble,項目名稱:banshee,代碼行數:8,代碼來源:Track.cs

示例10: LIBMTP_Get_Supported_Filetypes

 private static extern int LIBMTP_Get_Supported_Filetypes (MtpDeviceHandle handle, ref IntPtr types, ref ushort count); // uint16_t **const
開發者ID:petejohanson,項目名稱:banshee,代碼行數:1,代碼來源:MtpDevice.cs

示例11: LIBMTP_Get_Errorstack

 private static extern IntPtr LIBMTP_Get_Errorstack (MtpDeviceHandle handle); // LIBMTP_error_t *
開發者ID:petejohanson,項目名稱:banshee,代碼行數:1,代碼來源:MtpDevice.cs

示例12: LIBMTP_Set_Friendlyname

 private static extern int LIBMTP_Set_Friendlyname (MtpDeviceHandle handle, string name);
開發者ID:petejohanson,項目名稱:banshee,代碼行數:1,代碼來源:MtpDevice.cs

示例13: LIBMTP_Get_Album_List

 static extern IntPtr LIBMTP_Get_Album_List (MtpDeviceHandle handle); // LIBMTP_album_t*
開發者ID:petejohanson,項目名稱:banshee,代碼行數:1,代碼來源:Album.cs

示例14: LIBMTP_Get_Album

 static extern IntPtr LIBMTP_Get_Album (MtpDeviceHandle handle, uint albumId); // LIBMTP_album_t*
開發者ID:petejohanson,項目名稱:banshee,代碼行數:1,代碼來源:Album.cs

示例15: GetTrackListing

 internal static IntPtr GetTrackListing(MtpDeviceHandle handle, ProgressFunction function, IntPtr data)
 {
     return LIBMTP_Get_Tracklisting_With_Callback (handle, function, data);
 }
開發者ID:ptrimble,項目名稱:banshee,代碼行數:4,代碼來源:Track.cs


注:本文中的Mtp.MtpDeviceHandle類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。