F1 Change

This commit is contained in:
2025-03-07 11:57:24 +09:00
parent 0790ae42f9
commit 9be4b773a5
6 changed files with 107 additions and 77 deletions

View File

@@ -1,4 +1,6 @@
using System;
using System.IO;
using System.Windows.Forms.DataVisualization.Charting;
using DDUtilityApp.DATA;
using JWH.DATA;
@@ -11,33 +13,74 @@ namespace DDUtilityApp.LOGPARSER.DATA
public class LogFile : DataTableBase
{
private string m_FullName = string.Empty;
public Account Account { get; set; } = null;
public string Name { get; set; }
public string FullName
{
get { return this.m_FullName; }
set
{
this.m_FullName = value;
this.DirectoryName = Path.GetDirectoryName(value);
this.FileName = Path.GetFileName(value);
this.Name = Path.GetFileNameWithoutExtension(value);
this.Extension = Path.GetExtension(value);
}
}
public string DirectoryName { get; private set; }
public string FileName { get; private set; }
public string Name { get; private set; }
public string Extension { get; private set; }
public long Length { get; set; }
public string Extension { get; set; }
public string FullName { get; set; }
public DateTime CreationTime { get; set; }
public DateTime LastAccessTime { get; set; }
public DateTime LastWriteTime { get; set; }
public string DestFullName { get; set; }
public LogFile()
{
}
public LogFile(string fullName)
{
this.Name = System.IO.Path.GetFileNameWithoutExtension(fullName);
this.FullName = fullName;
this.Extension = System.IO.Path.GetExtension(fullName);
}
public string GetFileSize(FileSizeType format = FileSizeType.Auto)
{
int index = 0;
int nFormat = (int)format;
double value = this.Length;
for (index = 0; index < nFormat; index++)
{
if (format == FileSizeType.Auto && value < 1024) break;
value /= 1024;
}
return $"{value.ToString("N2")} {(FileSizeType)index}";
}
}
public enum FileSizeType
{
Bt = 0,
KB = 1,
MB = 2,
GB = 3,
TB = 4,
Auto = 9,
}
}