mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 05:57:59 +00:00
Added an information view to all data sources (#273)
This commit is contained in:
1 parent
9d71978feb
commit
c836bd7f33
61 files changed
+1596
-1372
No files matched your search
@@ -0,0 +1,17 @@
|
||||
namespace AIStudio.Tools;
|
||||
|
||||
public static class FileInfoExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the file size in human-readable format.
|
||||
/// </summary>
|
||||
/// <param name="fileInfo">The file info object.</param>
|
||||
/// <returns>The file size in human-readable format.</returns>
|
||||
public static string FileSize(this FileInfo fileInfo)
|
||||
{
|
||||
if (!fileInfo.Exists)
|
||||
return "N/A";
|
||||
|
||||
return fileInfo.Length.FileSize();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user