mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 10:47:21 +00:00
Moved all extension methods into extension blocks (#1155)
This commit is contained in:
1 parent
acc7d09fa2
commit
c0a75f39ac
138 files changed
+5884
-4954
No files matched your search
@@ -2,16 +2,19 @@ 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)
|
||||
extension(FileInfo fileInfo)
|
||||
{
|
||||
if (!fileInfo.Exists)
|
||||
return "N/A";
|
||||
/// <summary>
|
||||
/// Returns the file size in human-readable format.
|
||||
/// </summary>
|
||||
/// <returns>The file size in human-readable format.</returns>
|
||||
public string FileSize()
|
||||
{
|
||||
if (!fileInfo.Exists)
|
||||
return "N/A";
|
||||
|
||||
return fileInfo.Length.FileSize();
|
||||
return fileInfo.Length.FileSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user