Fix LibrarySelection -> Rename
- RenameButtonRenameLocalLibraryItem test passing - Get LibrarySelection->Remove action to compile after refactoring - Make LibraryRenameSelectedItem an extension method and update callers
This commit is contained in:
parent
d8afb799ca
commit
ce6a3834fc
8 changed files with 102 additions and 122 deletions
|
|
@ -36,6 +36,8 @@ namespace MatterHackers.MatterControl.Library
|
|||
/// </summary>
|
||||
public class FileSystemItem : ILibraryItem
|
||||
{
|
||||
private string fileName;
|
||||
|
||||
public string Path { get; set; }
|
||||
public string Category { get; set; }
|
||||
public string ThumbnailKey { get; set; } = "";
|
||||
|
|
@ -45,11 +47,22 @@ namespace MatterHackers.MatterControl.Library
|
|||
public FileSystemItem(string path)
|
||||
{
|
||||
this.Path = path;
|
||||
this.Name = System.IO.Path.GetFileName(path);
|
||||
}
|
||||
|
||||
public string ID => this.Path.GetHashCode().ToString();
|
||||
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
if (fileName == null)
|
||||
{
|
||||
fileName = System.IO.Path.GetFileName(this.Path);
|
||||
}
|
||||
|
||||
return fileName;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue