/// <summary> /// 获取sdk缓存文件信息 /// </summary> /// <param name="accountID">查询的账号ID</param> /// <param name="fileType">文件类型</param> /// <param name="endtime">查询时间截止点(查询全部填0)</param> /// <param name="cb"></param> public static void GetCacheFileInfo(string accountID, CacheFileType fileType, long endtime, GetCacheFileInfoDelegate cb) { string fileTypeStr = GetCacheFileTypeDesc(fileType); var ptr = DelegateConverter.ConvertToIntPtr(cb); NIMGlobalNativeMethods.nim_global_get_sdk_cache_file_info_async(accountID, fileTypeStr, endtime, null, GetCacheFileInfoCb, ptr); }
/// <summary> /// Appends a file string to the end of a directory path /// </summary> /// <param name="path">The directory path to get the file string</param> /// <param name="fileName">The name of the file to addend to directory</param> /// <param name="fileType">The type of file to append to directory</param> /// <returns>The appended file extension to passed in <see cref="string"/></returns> public static string AppendFileToDirectory(string path, string fileName, CacheFileType fileType) { // Replace any '\' in path with '/' for betting cache reading and writing string directoryPath = path.Replace(@"\", @"/"); // Append new file string to directory path directoryPath += $"/{ fileName }.{ fileType }"; // Return the directory path with all '/' replace with '\' return(directoryPath.Replace(@"/", @"\")); }
private static string GetCacheFileTypeDesc(CacheFileType fileType) { string fileTypeStr = string.Empty; switch (fileType) { case CacheFileType.Audio: fileTypeStr = "audio"; break; case CacheFileType.Image: fileTypeStr = "image"; break; case CacheFileType.Misc: fileTypeStr = "res"; break; case CacheFileType.Video: fileTypeStr = "video"; break; } return(fileTypeStr); }
public CacheChangedEventArgs(string fileName, CacheFileType fileType) { this.FileName = fileName; this.FileType = fileType; }