Turned getter-like extension methods into extension properties (#1157)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-04 13:00:56 +01:00
1 parent 0375318b1b
commit f649febf88
286 files changed
+1379 -1109

No files matched your search

+5 -5
View File
@@ -32,24 +32,24 @@ public sealed record MessageFile(int Ordinal, int Position, string Caption, File
/// Returns the name of the file's type as shown to the user, for example "Webpage (.html)" or
/// "Python (.py)".
/// </summary>
public string ToName() => this.IsSourceCode ? this.Language.ToName() : this.Format.ToName();
public string ToName() => this.IsSourceCode ? this.Language.ToName() : this.Format.Name;
/// <summary>
/// Returns the icon of the file's type.
/// </summary>
public string ToIcon() => this.Format.ToIcon();
public string ToIcon() => this.Format.Icon;
/// <summary>
/// Returns what tells a file of this type apart: its extension, for example ".html", or the
/// fixed name a tool looks for, such as Dockerfile.
/// </summary>
public string ToFileExtensionOrName() => this.IsSourceCode ? this.Language.ToFileExtensionOrName() : this.Format.ToFileExtension();
public string ToFileExtensionOrName() => this.IsSourceCode ? this.Language.ToFileExtensionOrName() : this.Format.FileExtension;
/// <summary>
/// Returns the filter which the save dialog offers for the file.
/// </summary>
/// <returns>The filter, or null when AI Studio cannot write the file itself.</returns>
public FileTypeFilter? ToFileTypeFilter() => this.IsSourceCode ? this.Language.ToFileTypeFilter() : this.Format.ToFileTypeFilter();
public FileTypeFilter? ToFileTypeFilter() => this.IsSourceCode ? this.Language.ToFileTypeFilter() : this.Format.FileTypeFilter;
/// <summary>
/// Returns the file name the save dialog starts with.
@@ -61,5 +61,5 @@ public sealed record MessageFile(int Ordinal, int Position, string Caption, File
/// <summary>
/// Returns the encoding the file gets written with.
/// </summary>
public Encoding ToFileEncoding() => this.IsSourceCode ? this.Language.ToFileEncoding() : this.Format.ToFileEncoding();
public Encoding ToFileEncoding() => this.IsSourceCode ? this.Language.ToFileEncoding() : this.Format.FileEncoding;
}