Optimalization, file name&extension

This commit is contained in:
2022-02-08 09:53:20 +01:00
parent 2b5ab06b57
commit 755793c85c
22 changed files with 268 additions and 85 deletions

View File

@@ -103,6 +103,20 @@ namespace FileTime.Providers.Local
public Task Rename(string newName) => throw new NotSupportedException();
public Task<bool> CanOpen() => Task.FromResult(true);
public void Dispose() { }
public void Dispose()
{
foreach (var c in _rootContainers)
{
c.Unload();
}
}
public void Unload()
{
foreach (var c in _rootContainers)
{
c.Unload();
}
}
}
}

View File

@@ -27,7 +27,7 @@ namespace FileTime.Providers.Local
public SupportsDelete CanDelete { get; }
public bool CanRename => true;
public AsyncEventHandler Refreshed { get; } = new();
public AsyncEventHandler Refreshed { get; private set; } = new();
public string Attributes => GetAttributes();
@@ -191,6 +191,14 @@ namespace FileTime.Providers.Local
_containers = null;
_elements = null;
IsDisposed = true;
Refreshed = new AsyncEventHandler();
}
public void Unload()
{
_items = null;
_containers = null;
_elements = null;
}
}
}