From d7ada9e413e16eaceab9fd1f3bc496b95d563407 Mon Sep 17 00:00:00 2001 From: GoldenCrystal Date: Fri, 14 Nov 2014 02:19:53 +0100 Subject: [PATCH] Display the code points next to the glyphs in the list, and tweak the UI a bit. --- UnicodeCharacterInspector/MainWindow.xaml | 17 +++++++++--- .../StringToUtf32Converter.cs | 26 +++++++++++++++++++ .../UnicodeCharacterInspector.csproj | 2 ++ 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 UnicodeCharacterInspector/StringToUtf32Converter.cs diff --git a/UnicodeCharacterInspector/MainWindow.xaml b/UnicodeCharacterInspector/MainWindow.xaml index a1ab8d1..7820420 100644 --- a/UnicodeCharacterInspector/MainWindow.xaml +++ b/UnicodeCharacterInspector/MainWindow.xaml @@ -13,6 +13,9 @@ + + + diff --git a/UnicodeCharacterInspector/StringToUtf32Converter.cs b/UnicodeCharacterInspector/StringToUtf32Converter.cs new file mode 100644 index 0000000..d6c6b36 --- /dev/null +++ b/UnicodeCharacterInspector/StringToUtf32Converter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace UnicodeCharacterInspector +{ + internal class StringToUtf32Converter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + string text = value as string; + + if (!string.IsNullOrEmpty(text)) return char.ConvertToUtf32(text, 0); + else return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/UnicodeCharacterInspector/UnicodeCharacterInspector.csproj b/UnicodeCharacterInspector/UnicodeCharacterInspector.csproj index d79c990..426225d 100644 --- a/UnicodeCharacterInspector/UnicodeCharacterInspector.csproj +++ b/UnicodeCharacterInspector/UnicodeCharacterInspector.csproj @@ -13,6 +13,7 @@ 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 + f1bfc594 AnyCPU @@ -64,6 +65,7 @@ + MainWindow.xaml Code