enhance: only show syntax-highlighting toggle if current revision content is a text file

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-07 20:27:52 +08:00
parent f830b68f6a
commit 74f52fb266
No known key found for this signature in database
3 changed files with 49 additions and 1 deletions

View file

@ -0,0 +1,27 @@
using System;
using System.Globalization;
using Avalonia.Data.Converters;
namespace SourceGit.Converters
{
public static class ObjectConverters
{
public class IsTypeOfConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || parameter == null)
return false;
return value.GetType().IsAssignableTo((Type)parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return new NotImplementedException();
}
}
public static readonly IsTypeOfConverter IsTypeOf = new IsTypeOfConverter();
}
}