Made the file system provider able to navigate folders.
This commit is contained in:
parent
d2f1ba4b22
commit
c38b4de0ba
11 changed files with 185 additions and 110 deletions
|
|
@ -52,6 +52,25 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
GetFilesInCurrentDirectory();
|
||||
}
|
||||
|
||||
public LibraryProviderFileSystem(PrintItemCollection collectionBase)
|
||||
{
|
||||
this.rootPath = collectionBase.Key;
|
||||
|
||||
GetFilesInCurrentDirectory();
|
||||
}
|
||||
|
||||
public override void SetCollectionBase(PrintItemCollection collectionBase)
|
||||
{
|
||||
string collectionPath = collectionBase.Key;
|
||||
int startOfCurrentDir = collectionPath.IndexOf('.');
|
||||
if (startOfCurrentDir != -1)
|
||||
{
|
||||
this.currentDirectory = collectionPath.Substring(startOfCurrentDir);
|
||||
}
|
||||
|
||||
GetFilesInCurrentDirectory();
|
||||
}
|
||||
|
||||
public override int CollectionCount
|
||||
{
|
||||
get
|
||||
|
|
@ -96,6 +115,17 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override PrintItemCollection GetParentCollectionItem()
|
||||
{
|
||||
if (currentDirectory != ".")
|
||||
{
|
||||
string parentDirectory = Path.GetDirectoryName(currentDirectory);
|
||||
return new PrintItemCollection("..", parentDirectory);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override PrintItemCollection GetCollectionItem(int collectionIndex)
|
||||
{
|
||||
string directoryName = currentDirectoryDirectories[collectionIndex];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue