sourcegit/src/Views/Converters/PureFolderName.cs

22 lines
602 B
C#
Raw Normal View History

2021-04-29 05:05:55 -07:00
using System;
2020-07-03 00:24:31 -07:00
using System.Globalization;
2021-04-29 05:05:55 -07:00
using System.IO;
2020-07-03 00:24:31 -07:00
using System.Windows.Data;
2021-04-29 05:05:55 -07:00
namespace SourceGit.Views.Converters {
2020-07-03 00:24:31 -07:00
/// <summary>
2021-04-29 05:05:55 -07:00
/// 将路径转换为纯目录
2020-07-03 00:24:31 -07:00
/// </summary>
2021-04-29 05:05:55 -07:00
public class PureFolderName : IValueConverter {
2020-07-03 00:24:31 -07:00
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
2021-04-29 05:05:55 -07:00
return Path.GetDirectoryName(value as string);
2020-07-03 00:24:31 -07:00
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
throw new NotImplementedException();
}
}
}