本文整理汇总了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;
}
示例2: LIBMTP_Get_Friendlyname
private static extern IntPtr LIBMTP_Get_Friendlyname (MtpDeviceHandle handle); // char *
示例3: LIBMTP_Get_Folder_List
private static extern IntPtr LIBMTP_Get_Folder_List (MtpDeviceHandle handle); // LIBMTP_folder_t*
示例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;
}
示例5: LIBMTP_Get_Representative_Sample_Format
private static extern int LIBMTP_Get_Representative_Sample_Format (MtpDeviceHandle handle, FileType type, IntPtr data_array);
示例6: LIBMTP_Get_Filemetadata
private static extern IntPtr LIBMTP_Get_Filemetadata (MtpDeviceHandle handle, uint fileid); // LIBMTP_file_t *
示例7: LIBMTP_Get_Filelisting
private static extern IntPtr LIBMTP_Get_Filelisting (MtpDeviceHandle handle); // LIBMTP_file_t *
示例8: LIBMTP_Create_New_Album
internal static extern int LIBMTP_Create_New_Album (MtpDeviceHandle handle, ref AlbumStruct album, uint parentId);
示例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");
}
}
示例10: LIBMTP_Get_Supported_Filetypes
private static extern int LIBMTP_Get_Supported_Filetypes (MtpDeviceHandle handle, ref IntPtr types, ref ushort count); // uint16_t **const
示例11: LIBMTP_Get_Errorstack
private static extern IntPtr LIBMTP_Get_Errorstack (MtpDeviceHandle handle); // LIBMTP_error_t *
示例12: LIBMTP_Set_Friendlyname
private static extern int LIBMTP_Set_Friendlyname (MtpDeviceHandle handle, string name);
示例13: LIBMTP_Get_Album_List
static extern IntPtr LIBMTP_Get_Album_List (MtpDeviceHandle handle); // LIBMTP_album_t*
示例14: LIBMTP_Get_Album
static extern IntPtr LIBMTP_Get_Album (MtpDeviceHandle handle, uint albumId); // LIBMTP_album_t*
示例15: GetTrackListing
internal static IntPtr GetTrackListing(MtpDeviceHandle handle, ProgressFunction function, IntPtr data)
{
return LIBMTP_Get_Tracklisting_With_Callback (handle, function, data);
}