NativePath, Editor, ToastMessageSink

This commit is contained in:
2022-02-15 19:47:38 +01:00
parent b11d009195
commit 45defb4021
28 changed files with 265 additions and 54 deletions

View File

@@ -24,6 +24,7 @@ namespace FileTime.Providers.Smb
public string Name { get; } = "smb";
public string? FullName { get; }
public string? NativePath => null;
public bool IsHidden => false;
public bool IsLoaded => true;
@@ -177,5 +178,7 @@ namespace FileTime.Providers.Smb
}
}
}
public static string GetNativePath(string fullName) => fullName.Replace("/", "\\");
}
}

View File

@@ -1,6 +1,5 @@
using FileTime.Core.Models;
using FileTime.Core.Providers;
using SMBLibrary.Client;
namespace FileTime.Providers.Smb
{
@@ -11,6 +10,7 @@ namespace FileTime.Providers.Smb
public string Name { get; }
public string? FullName { get; }
public string? NativePath { get; }
public bool IsHidden => false;
public SupportsDelete CanDelete => SupportsDelete.True;
@@ -25,6 +25,7 @@ namespace FileTime.Providers.Smb
{
Name = name;
FullName = parent.FullName + Constants.SeparatorChar + Name;
NativePath = SmbContentProvider.GetNativePath(FullName);
Provider = provider;
_parent = parent;

View File

@@ -1,8 +1,6 @@
using AsyncEvent;
using FileTime.Core.Models;
using FileTime.Core.Providers;
using SMBLibrary;
using SMBLibrary.Client;
namespace FileTime.Providers.Smb
{
@@ -17,6 +15,7 @@ namespace FileTime.Providers.Smb
public string Name { get; }
public string? FullName { get; }
public string? NativePath { get; }
public bool IsHidden => false;
public bool IsLoaded => _items != null;
@@ -40,6 +39,7 @@ namespace FileTime.Providers.Smb
Name = name;
FullName = parent?.FullName == null ? Name : parent.FullName + Constants.SeparatorChar + Name;
NativePath = SmbContentProvider.GetNativePath(FullName);
Provider = contentProvider;
}

View File

@@ -24,8 +24,8 @@ namespace FileTime.Providers.Smb
public string? Password { get; private set; }
public string Name { get; }
public string? FullName { get; }
public string? NativePath { get; }
public bool IsHidden => false;
public bool IsLoaded => _items != null;
@@ -51,7 +51,7 @@ namespace FileTime.Providers.Smb
Password = password;
Provider = contentProvider;
FullName = Name = path;
NativePath = FullName = Name = path;
}
public async Task<IReadOnlyList<IItem>?> GetItems(CancellationToken token = default)

View File

@@ -17,6 +17,7 @@ namespace FileTime.Providers.Smb
public string Name { get; }
public string? FullName { get; }
public string? NativePath { get; }
public bool IsHidden => false;
public bool IsLoaded => _items != null;
@@ -40,6 +41,7 @@ namespace FileTime.Providers.Smb
Name = name;
FullName = parent?.FullName == null ? Name : parent.FullName + Constants.SeparatorChar + Name;
NativePath = SmbContentProvider.GetNativePath(FullName);
Provider = contentProvider;
}