mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 02:07: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
@@ -13,13 +13,16 @@ public static class ModelImageErrorCodeExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ModelImageErrorCodeExtensions).Namespace, nameof(ModelImageErrorCodeExtensions));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the localized message which explains why an image was not sent to the AI.
|
||||
/// </summary>
|
||||
/// <param name="code">Why the image could not be prepared.</param>
|
||||
/// <param name="fileName">The name of the image file, as shown to the user.</param>
|
||||
/// <returns>The localized message.</returns>
|
||||
public static string ToUserMessage(this ModelImageErrorCode code, string fileName) => string.Format(ToUserMessageFormat(code), fileName);
|
||||
extension(ModelImageErrorCode code)
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the localized message which explains why an image was not sent to the AI.
|
||||
/// </summary>
|
||||
/// <param name="fileName">The name of the image file, as shown to the user.</param>
|
||||
/// <returns>The localized message.</returns>
|
||||
public string ToUserMessage(string fileName) => string.Format(ToUserMessageFormat(code), fileName);
|
||||
}
|
||||
|
||||
private static string ToUserMessageFormat(ModelImageErrorCode code) => code switch
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user