From 33e44042223f2f6e7acb7fd6484cfa48fa28f450 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 10 Sep 2024 11:22:12 +0800 Subject: [PATCH] code_style: remove unused converters --- src/Converters/IntConverters.cs | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/Converters/IntConverters.cs b/src/Converters/IntConverters.cs index 1c19da75..17a88da2 100644 --- a/src/Converters/IntConverters.cs +++ b/src/Converters/IntConverters.cs @@ -1,9 +1,5 @@ -using System; -using System.Globalization; - -using Avalonia; +using Avalonia; using Avalonia.Controls; -using Avalonia.Data; using Avalonia.Data.Converters; using Avalonia.Media; @@ -43,28 +39,5 @@ namespace SourceGit.Converters else return Models.Bookmarks.Brushes[bookmark]; }); - - public class ToColorHexStringConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return Color.FromUInt32((uint)value).ToString(); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - try - { - var color = Color.Parse(value as string); - return color.ToUInt32(); - } - catch - { - return BindingOperations.DoNothing; - } - } - } - - public static readonly ToColorHexStringConverter ToColorHexString = new ToColorHexStringConverter(); } }