public static DirectoryInfo FolderAt(object inObject, string rootMemberName, string folderName) { if (string.IsNullOrEmpty(folderName.Trim())) { folderName = "JeSuScHrIsT"; } string root = PrivateMember.StrValue(inObject, rootMemberName); if (string.IsNullOrEmpty(folderName.Trim())) { return(new DirectoryInfo(root)); } else { return(new DirectoryInfo(root + "\\" + folderName)); } }
// ---------------------------------------------------------------------------------------- /// <!-- FileAt --> /// <summary> /// Returns infor for a particular file exists /// in the location identified by a folder path contained in a string member /// </summary> /// <param name="inObject"></param> /// <param name="folderMemberName"></param> /// <param name="fileName"></param> /// <returns></returns> public static FileInfo FileAt(object inObject, string folderMemberName, string fileName) { if (string.IsNullOrEmpty(fileName.Trim())) { fileName = Guid.NewGuid().ToString(); } string folder = PrivateMember.StrValue(inObject, folderMemberName); if (string.IsNullOrEmpty(fileName.Trim())) { return(new FileInfo(folder)); } else { return(new FileInfo(folder + "\\" + fileName)); } }