diff --git a/app/MindWork AI Studio/Chat/FileAttachment.cs b/app/MindWork AI Studio/Chat/FileAttachment.cs index bacae923..a98b3574 100644 --- a/app/MindWork AI Studio/Chat/FileAttachment.cs +++ b/app/MindWork AI Studio/Chat/FileAttachment.cs @@ -11,20 +11,37 @@ namespace AIStudio.Chat; /// The size of the file in bytes. public readonly record struct FileAttachment(FileAttachmentType Type, string FileName, string FilePath, long FileSizeBytes) { - /// - /// Gets a value indicating whether the file still exists on the file system. - /// - public bool Exists => File.Exists(this.FilePath); - /// /// Gets a value indicating whether the file type is forbidden and should not be attached. /// - public bool IsForbidden => this.Type == FileAttachmentType.FORBIDDEN; + /// + /// The state is determined once during construction and does not change. + /// + public bool IsForbidden { get; } = Type == FileAttachmentType.FORBIDDEN; /// /// Gets a value indicating whether the file type is valid and allowed to be attached. /// - public bool IsValid => this.Type != FileAttachmentType.FORBIDDEN; + /// + /// The state is determined once during construction and does not change. + /// + public bool IsValid { get; } = Type != FileAttachmentType.FORBIDDEN; + + /// + /// Gets a value indicating whether the file type is an image. + /// + /// + /// The state is determined once during construction and does not change. + /// + public bool IsImage { get; } = Type == FileAttachmentType.IMAGE; + + /// + /// Gets a value indicating whether the file still exists on the file system. + /// + /// + /// This property checks the file system each time it is accessed. + /// + public bool Exists => File.Exists(this.FilePath); /// /// Creates a FileAttachment from a file path by automatically determining the type,