Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
699 B

1 year ago
using System.Globalization;
using Avalonia.Data.Converters;
using Microsoft.Extensions.Logging;
namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Converters;
public class EventIdConverter : IValueConverter
{
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is null)
return "0";
var eventId = (EventId)value;
return eventId.ToString();
}
// If not implemented, an error is thrown
1 year ago
public object ConvertBack(
object? value,
Type targetType,
object? parameter,
CultureInfo culture
) => new EventId(0, value?.ToString() ?? string.Empty);
1 year ago
}