Fixing test

This commit is contained in:
Lars Brubaker 2021-03-26 13:15:54 -07:00
parent 1ecf32f4d8
commit 29e58ee3f3
9 changed files with 8 additions and 364 deletions

View file

@ -354,7 +354,7 @@ namespace MatterHackers.MatterControl.Library
public class DirectoryContainerLink : FileSystemItem, ILibraryContainerLink
{
public DirectoryContainerLink(string path)
: base(path, null)
: base(path)
{
}

View file

@ -35,8 +35,8 @@ namespace MatterHackers.MatterControl.Library
{
public class FileSystemFileItem : FileSystemItem, ILibraryAssetStream
{
public FileSystemFileItem(string path, Func<FileSystemItem, string> getFirstSaveName = null)
: base(path, getFirstSaveName)
public FileSystemFileItem(string path)
: base(path)
{
var fileInfo = new FileInfo(path);
if (fileInfo.Exists)

View file

@ -40,13 +40,9 @@ namespace MatterHackers.MatterControl.Library
{
private string fileName;
private Func<FileSystemItem, string> getFirstSaveName;
public FileSystemItem(string path, Func<FileSystemItem, string> getFirstSaveName = null)
public FileSystemItem(string path)
{
this.Path = path;
this.getFirstSaveName = getFirstSaveName;
var type = GetType();
try
@ -105,25 +101,6 @@ namespace MatterHackers.MatterControl.Library
}
}
private string _path;
public string Path
{
get
{
if (getFirstSaveName != null)
{
var newPath = getFirstSaveName(this);
if (!string.IsNullOrEmpty(newPath))
{
getFirstSaveName = null;
_path = newPath;
}
}
return _path;
}
set => _path = value;
}
public string Path { get; set; }
}
}