/// <summary> /// 创建一个新参数 /// </summary> /// <returns></returns> public static TraverseEventArg Create(FolderFileInfo data) { var e = new TraverseEventArg(); e.Data = data; return(e); }
///<summary> /// /// </summary> public static FolderFileInfo GetInst(string fileOrFolderPath) { FolderFileInfo item = new FolderFileInfo(); item.fileInfo = (File.Exists(fileOrFolderPath)) ? new FileInfo(fileOrFolderPath) : null; item.directoryInfo = (Directory.Exists(fileOrFolderPath)) ? new DirectoryInfo(fileOrFolderPath) : null; return(item); }
/// <summary> /// /// </summary> /// <param name="filePath"></param> /// <returns></returns> public FolderFileInfo GetFileInfo(string filePath) { FolderFileInfo item = new FolderFileInfo(); if (StringChecker.IsPhysicalPath(filePath)) { item = FolderFileInfo.GetInst(filePath); } return(item); }
/// <summary> /// 获取一个文件夹的基本信息 /// </summary> /// <param name="path"></param> /// <returns></returns> public FolderFileInfo GetFolderInfo(string path) { var folderInfo = FolderFileInfo.GetInst(path); return(folderInfo); }