Merge pull request #2504 from jlewin/design_tools

Named item for 'Create Folder'
This commit is contained in:
johnlewin 2017-09-27 21:45:30 -07:00 committed by GitHub
commit e111a2d632
2 changed files with 17 additions and 2 deletions

View file

@ -33,13 +33,24 @@ using MatterHackers.Agg.Image;
namespace MatterHackers.MatterControl.Library
{
public class NewFolderItem : ILibraryItem
{
public string ID { get; } = Guid.NewGuid().ToString();
public string Name { get; set; }
public bool IsProtected => false;
public bool IsVisible => true;
}
public class DynamicContainerLink : ILibraryContainerLink, IThumbnail
{
public string ID { get; set; }
public string Name { get; }
public string Category { get; set; }
public string ThumbnailKey => thumbnail.GetHashCode().ToString();
public bool IsProtected => true;
public bool IsProtected { get; set; } = true;
public bool IsReadOnly { get; set; } = false;

View file

@ -312,7 +312,11 @@ namespace MatterHackers.MatterControl.PrintLibrary
if (!string.IsNullOrEmpty(result.newName)
&& this.libraryView.ActiveContainer is ILibraryWritableContainer writableContainer)
{
writableContainer.Add(new[] { new DynamicContainerLink(result.newName, null) });
writableContainer.Add(
new[]
{
new NewFolderItem() { Name = result.newName }
});
}
});
createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; };