-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sporo zmian dotyczących wczytywania tablic
- Loading branch information
1 parent
43364ab
commit 2906c0e
Showing
12 changed files
with
457 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Converters; | ||
|
||
public class StringConverterAllowNumber : JsonConverter<string> | ||
{ | ||
public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return reader.TokenType switch | ||
{ | ||
// Obsługa wartości null | ||
JsonTokenType.Null => null, | ||
// Obsługa ciągów znaków | ||
JsonTokenType.String => reader.GetString(), | ||
// Obsługa liczb | ||
JsonTokenType.Number => reader.GetDouble().ToString(CultureInfo.InvariantCulture), | ||
// Obsługa wartości logicznych | ||
JsonTokenType.True or JsonTokenType.False => reader.GetBoolean().ToString(), | ||
_ => throw new JsonException( | ||
$"Nieoczekiwany typ tokenu {reader.TokenType} podczas parsowania ciągu znaków.") | ||
}; | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, string? value, JsonSerializerOptions options) | ||
{ | ||
writer.WriteStringValue(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Avalonia.Data.Converters; | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace ChatAAC.Converters | ||
{ | ||
public class StringNotEmptyToBoolConverter : IValueConverter | ||
{ | ||
public static StringNotEmptyToBoolConverter Instance { get; } = new StringNotEmptyToBoolConverter(); | ||
|
||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
return !string.IsNullOrEmpty(value as string); | ||
} | ||
|
||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace ChatAAC.Models; | ||
|
||
public class ConfigData | ||
{ | ||
public string OllamaAddress { get; set; } = string.Empty; | ||
public string SelectedModel { get; set; } = string.Empty; | ||
public bool ShowSex { get; set; } | ||
public bool ShowViolence { get; set; } | ||
public bool ShowAac { get; set; } | ||
public bool ShowSchematic { get; set; } | ||
public string? SelectedLanguage { get; set; } | ||
public int LoadedIconsCount { get; set; } | ||
public string DefaultBoardPath { get; set; } = string.Empty; | ||
public List<string> BoardPaths { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.