35 lines
994 B
C#
35 lines
994 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Text.RegularExpressions;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace AffdexMe
|
|||
|
{
|
|||
|
public class UpperCaseConverter : System.Windows.Data.IValueConverter
|
|||
|
{
|
|||
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|||
|
{
|
|||
|
return SplitCamelCase(((String)value)).ToUpper();
|
|||
|
}
|
|||
|
|
|||
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|||
|
{
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
public string SplitCamelCase(String str)
|
|||
|
{
|
|||
|
return Regex.Replace(
|
|||
|
Regex.Replace(
|
|||
|
str,
|
|||
|
@"(\P{Ll})(\P{Ll}\p{Ll})",
|
|||
|
"$1 $2"
|
|||
|
),
|
|||
|
@"(\p{Ll})(\P{Ll})",
|
|||
|
"$1 $2"
|
|||
|
);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|