making authoritative source, refactoring

This commit is contained in:
LarsBrubaker 2021-03-23 08:12:52 -07:00
parent fbccc9b68b
commit 3817d510eb
24 changed files with 290 additions and 137 deletions

View file

@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.Library
this.Items = new List<ILibraryItem>();
this.IsProtected = true;
DefaultSort = new SortBehavior()
DefaultSort = new LibrarySortBehavior()
{
SortKey = SortKey.ModifiedDate,
};
@ -105,13 +105,6 @@ namespace MatterHackers.MatterControl.Library
{
File.Move(mcxPath, filename);
}
// change the path in the workspaces
// w.SceneContext.EditContext?.SourceFilePath
var workspace = ApplicationController.Instance.Workspaces.Where(w => w.SceneContext.EditContext?.SourceFilePath == mcxPath).FirstOrDefault();
if (workspace != null)
{
workspace.SceneContext.EditContext.SourceFilePath = filename;
}
fileItem.Name = newName;
fileItem.Path = filename;