本文整理汇总了C#中Mtp.MtpDeviceHandle类的典型用法代码示例。如果您正苦于以下问题:C# MtpDeviceHandle类的具体用法?C# MtpDeviceHandle怎么用?C# MtpDeviceHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MtpDeviceHandle类属于Mtp命名空间,在下文中一共展示了MtpDeviceHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: LIBMTP_Update_Album
static extern int LIBMTP_Update_Album (MtpDeviceHandle handle, ref AlbumStruct album);
开发者ID:petejohanson,项目名称:banshee,代码行数:1,代码来源:Album.cs
示例17: SendTrack
internal static void SendTrack(MtpDeviceHandle handle, string path, ref TrackStruct metadata, ProgressFunction callback, IntPtr data)
{
if (LIBMTP_Send_Track_From_File (handle, path, ref metadata, callback, data) != 0)
{
LibMtpException.CheckErrorStack (handle);
throw new LibMtpException (ErrorCode.General, "Could not upload the track");
}
}
开发者ID:ptrimble,项目名称:banshee,代码行数:8,代码来源:Track.cs
示例18: LIBMTP_Get_Filelisting_With_Callback
private static extern IntPtr LIBMTP_Get_Filelisting_With_Callback (MtpDeviceHandle handle, ProgressFunction function, IntPtr data); // LIBMTP_file_t *
开发者ID:gclark916,项目名称:banshee,代码行数:1,代码来源:File.cs
示例19: UpdateTrackMetadata
internal static void UpdateTrackMetadata(MtpDeviceHandle handle, ref TrackStruct metadata)
{
if (LIBMTP_Update_Track_Metadata (handle, ref metadata) != 0)
throw new LibMtpException (ErrorCode.General);
}
开发者ID:ptrimble,项目名称:banshee,代码行数:5,代码来源:Track.cs
示例20: LIBMTP_Get_File_To_File
private static extern int LIBMTP_Get_File_To_File (MtpDeviceHandle handle, uint fileId, string path, ProgressFunction function, IntPtr data);
开发者ID:gclark916,项目名称:banshee,代码行数:1,代码来源:File.cs
注:本文中的Mtp.MtpDeviceHandle类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论