code_style: using avalonia's editorconfig and run dotnet format.

This commit is contained in:
leo 2024-03-31 16:54:29 +08:00
parent 3c38f681bd
commit d89a00e559
233 changed files with 1806 additions and 1254 deletions

View file

@ -6,17 +6,18 @@ namespace SourceGit.Converters
{
public static class PathConverters
{
public static FuncValueConverter<string, string> PureFileName =
public static readonly FuncValueConverter<string, string> PureFileName =
new FuncValueConverter<string, string>(fullpath => Path.GetFileName(fullpath) ?? "");
public static FuncValueConverter<string, string> PureDirectoryName =
public static readonly FuncValueConverter<string, string> PureDirectoryName =
new FuncValueConverter<string, string>(fullpath => Path.GetDirectoryName(fullpath) ?? "");
public static FuncValueConverter<string, string> TruncateIfTooLong =
public static readonly FuncValueConverter<string, string> TruncateIfTooLong =
new FuncValueConverter<string, string>(fullpath =>
{
if (fullpath.Length <= 50) return fullpath;
if (fullpath.Length <= 50)
return fullpath;
return fullpath.Substring(0, 20) + ".../" + Path.GetFileName(fullpath);
});
}
}
}