making authoritative source, refactoring
This commit is contained in:
parent
fbccc9b68b
commit
3817d510eb
24 changed files with 290 additions and 137 deletions
|
|
@ -244,7 +244,7 @@ namespace MatterHackers.MatterControl.Library.Export
|
|||
return errors;
|
||||
}
|
||||
|
||||
// This mush be calculated after the settings have been set (spiral vase)
|
||||
// This must be calculated after the settings have been set (spiral vase)
|
||||
// or it uses the wrong slice settings.
|
||||
// TODO: Prior code bypassed GCodeOverridePath mechanisms in EditContext. Consolidating into a single pathway
|
||||
gcodePath = await Printer.Bed.EditContext.GCodeFilePath(Printer);
|
||||
|
|
|
|||
36
MatterControlLib/Library/Interfaces/IAssetPath.cs
Normal file
36
MatterControlLib/Library/Interfaces/IAssetPath.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
Copyright (c) 2017, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
public interface IAssetPath
|
||||
{
|
||||
string AssetPath { get; }
|
||||
}
|
||||
}
|
||||
42
MatterControlLib/Library/Interfaces/ILibraryAsset.cs
Normal file
42
MatterControlLib/Library/Interfaces/ILibraryAsset.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
Copyright (c) 2017, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
public interface ILibraryAsset : ILibraryItem
|
||||
{
|
||||
string ContentType { get; }
|
||||
|
||||
string Category { get; }
|
||||
|
||||
string FileName { get; }
|
||||
|
||||
string AssetPath { get; }
|
||||
}
|
||||
}
|
||||
46
MatterControlLib/Library/Interfaces/ILibraryAssetStream.cs
Normal file
46
MatterControlLib/Library/Interfaces/ILibraryAssetStream.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright (c) 2017, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
public interface ILibraryAssetStream : ILibraryAsset
|
||||
{
|
||||
/// <summary>
|
||||
// Gets the size, in bytes, of the current file.
|
||||
/// </summary>
|
||||
long FileSize { get; }
|
||||
|
||||
bool LocalContentExists { get; }
|
||||
|
||||
Task<StreamAndLength> GetStream(Action<double, string> progress);
|
||||
}
|
||||
}
|
||||
|
|
@ -27,63 +27,56 @@ of the authors and should not be interpreted as representing official policies,
|
|||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using MatterHackers.Agg.Image;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.DataConverters3D;
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
[Flags]
|
||||
public enum SortKey
|
||||
public enum ContainerActions
|
||||
{
|
||||
Default = 0,
|
||||
Name = 1,
|
||||
CreatedDate = 2,
|
||||
ModifiedDate = 4,
|
||||
AddItems,
|
||||
|
||||
AddContainers,
|
||||
|
||||
RenameItems,
|
||||
|
||||
RemoveItems
|
||||
}
|
||||
|
||||
public interface ILibraryContainer : IDisposable
|
||||
{
|
||||
string ID { get; }
|
||||
|
||||
string Name { get; }
|
||||
|
||||
string StatusMessage { get; }
|
||||
|
||||
bool IsProtected { get; }
|
||||
|
||||
Type DefaultView { get; }
|
||||
|
||||
SortBehavior DefaultSort { get; }
|
||||
|
||||
event EventHandler ContentChanged;
|
||||
|
||||
string CollectionKeyName { get; }
|
||||
|
||||
List<ILibraryContainerLink> ChildContainers { get; }
|
||||
|
||||
List<ILibraryItem> Items { get; }
|
||||
string CollectionKeyName { get; }
|
||||
|
||||
ICustomSearch CustomSearch { get; }
|
||||
|
||||
LibrarySortBehavior DefaultSort { get; }
|
||||
|
||||
Type DefaultView { get; }
|
||||
|
||||
string ID { get; }
|
||||
|
||||
bool IsProtected { get; }
|
||||
|
||||
List<ILibraryItem> Items { get; }
|
||||
|
||||
string Name { get; }
|
||||
|
||||
ILibraryContainer Parent { get; set; }
|
||||
|
||||
Task<ImageBuffer> GetThumbnail(ILibraryItem item, int width, int height);
|
||||
|
||||
void Deactivate();
|
||||
string StatusMessage { get; }
|
||||
|
||||
void Activate();
|
||||
|
||||
void Deactivate();
|
||||
|
||||
Task<ImageBuffer> GetThumbnail(ILibraryItem item, int width, int height);
|
||||
|
||||
void Load();
|
||||
}
|
||||
|
||||
public enum ContainerActions
|
||||
{
|
||||
AddItems,
|
||||
AddContainers,
|
||||
RenameItems,
|
||||
RemoveItems
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,6 @@ either expressed or implied, of the FreeBSD Project.
|
|||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.DataConverters3D;
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
|
|
@ -47,42 +46,4 @@ namespace MatterHackers.MatterControl.Library
|
|||
|
||||
DateTime DateCreated { get; }
|
||||
}
|
||||
|
||||
public interface ILibraryObject3D : ILibraryAsset
|
||||
{
|
||||
Task<IObject3D> GetObject3D(Action<double, string> reportProgress);
|
||||
}
|
||||
|
||||
public interface IAssetPath
|
||||
{
|
||||
string AssetPath { get; }
|
||||
}
|
||||
|
||||
public interface ILibraryAssetStream : ILibraryAsset
|
||||
{
|
||||
/// <summary>
|
||||
// Gets the size, in bytes, of the current file.
|
||||
/// </summary>
|
||||
long FileSize { get; }
|
||||
|
||||
bool LocalContentExists { get; }
|
||||
|
||||
Task<StreamAndLength> GetStream(Action<double, string> progress);
|
||||
}
|
||||
|
||||
public interface IRequireInitialize
|
||||
{
|
||||
Task Initialize();
|
||||
}
|
||||
|
||||
public interface ILibraryAsset : ILibraryItem
|
||||
{
|
||||
string ContentType { get; }
|
||||
|
||||
string Category { get; }
|
||||
|
||||
string FileName { get; }
|
||||
|
||||
string AssetPath { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
40
MatterControlLib/Library/Interfaces/ILibraryObject3D.cs
Normal file
40
MatterControlLib/Library/Interfaces/ILibraryObject3D.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
Copyright (c) 2017, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.DataConverters3D;
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
public interface ILibraryObject3D : ILibraryAsset
|
||||
{
|
||||
Task<IObject3D> GetObject3D(Action<double, string> reportProgress);
|
||||
}
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
{
|
||||
public interface ILibraryWritableContainer : ILibraryContainer, IContentStore
|
||||
{
|
||||
event EventHandler<ItemChangedEventArgs> ItemContentChanged;
|
||||
event EventHandler<LibraryItemChangedEventArgs> ItemContentChanged;
|
||||
|
||||
void Add(IEnumerable<ILibraryItem> items);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ of the authors and should not be interpreted as representing official policies,
|
|||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
public class SortBehavior
|
||||
public interface IRequireInitialize
|
||||
{
|
||||
public SortKey SortKey { get; set; }
|
||||
|
||||
public bool Ascending { get; set; }
|
||||
Task Initialize();
|
||||
}
|
||||
}
|
||||
|
|
@ -36,11 +36,11 @@ using MatterHackers.DataConverters3D;
|
|||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
|
||||
public class ItemChangedEventArgs : EventArgs
|
||||
public class LibraryItemChangedEventArgs : EventArgs
|
||||
{
|
||||
public ILibraryItem LibraryItem { get; }
|
||||
|
||||
public ItemChangedEventArgs(ILibraryItem libraryItem)
|
||||
public LibraryItemChangedEventArgs(ILibraryItem libraryItem)
|
||||
{
|
||||
this.LibraryItem = libraryItem;
|
||||
}
|
||||
52
MatterControlLib/Library/Interfaces/LibrarySortBehavior.cs
Normal file
52
MatterControlLib/Library/Interfaces/LibrarySortBehavior.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright (c) 2017, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace MatterHackers.MatterControl.Library
|
||||
{
|
||||
[Flags]
|
||||
public enum SortKey
|
||||
{
|
||||
Default = 0,
|
||||
|
||||
Name = 1,
|
||||
|
||||
CreatedDate = 2,
|
||||
|
||||
ModifiedDate = 4,
|
||||
}
|
||||
|
||||
public class LibrarySortBehavior
|
||||
{
|
||||
public SortKey SortKey { get; set; }
|
||||
|
||||
public bool Ascending { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
|
||||
public virtual ICustomSearch CustomSearch { get; } = null;
|
||||
|
||||
public SortBehavior DefaultSort { get; set; }
|
||||
public LibrarySortBehavior DefaultSort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reloads the container when contents have changes and fires ContentChanged to notify listeners
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
public PrimitivesContainer()
|
||||
{
|
||||
Name = "Primitives".Localize();
|
||||
DefaultSort = new SortBehavior()
|
||||
DefaultSort = new LibrarySortBehavior()
|
||||
{
|
||||
SortKey = SortKey.ModifiedDate,
|
||||
Ascending = true,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
StaticData.Instance.LoadIcon(Path.Combine("Library", "history_icon.png")),
|
||||
() => new PrintHistoryContainer()
|
||||
{
|
||||
DefaultSort = new SortBehavior()
|
||||
DefaultSort = new LibrarySortBehavior()
|
||||
{
|
||||
SortKey = SortKey.ModifiedDate,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
|
||||
public ICustomSearch CustomSearch { get; } = null;
|
||||
|
||||
public SortBehavior DefaultSort => null;
|
||||
public LibrarySortBehavior DefaultSort => null;
|
||||
|
||||
public Task<ImageBuffer> GetThumbnail(ILibraryItem item, int width, int height)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ namespace MatterHackers.MatterControl.Library
|
|||
{
|
||||
public abstract class WritableContainer : LibraryContainer, ILibraryWritableContainer
|
||||
{
|
||||
public event EventHandler<ItemChangedEventArgs> ItemContentChanged;
|
||||
public event EventHandler<LibraryItemChangedEventArgs> ItemContentChanged;
|
||||
|
||||
public virtual void OnItemContentChanged(ItemChangedEventArgs args)
|
||||
public virtual void OnItemContentChanged(LibraryItemChangedEventArgs args)
|
||||
{
|
||||
this.ItemContentChanged?.Invoke(this, args);
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
// Serialize the scene to disk using a modified Json.net pipeline with custom ContractResolvers and JsonConverters
|
||||
File.WriteAllText(fileItem.Path, content.ToJson());
|
||||
|
||||
this.OnItemContentChanged(new ItemChangedEventArgs(fileItem));
|
||||
this.OnItemContentChanged(new LibraryItemChangedEventArgs(fileItem));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
{
|
||||
if (stashedSortOrder == null)
|
||||
{
|
||||
stashedSortOrder = new SortBehavior()
|
||||
stashedSortOrder = new LibrarySortBehavior()
|
||||
{
|
||||
SortKey = this.ActiveSort,
|
||||
Ascending = this.Ascending
|
||||
|
|
@ -193,7 +193,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
public IEnumerable<ListViewItem> Items => items;
|
||||
|
||||
private SortKey _activeSort = SortKey.Name;
|
||||
private SortBehavior stashedSortOrder;
|
||||
private LibrarySortBehavior stashedSortOrder;
|
||||
|
||||
public SortKey ActiveSort
|
||||
{
|
||||
|
|
@ -351,7 +351,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
|
|||
}
|
||||
}
|
||||
|
||||
private void WritableContainer_ItemContentChanged(object sender, ItemChangedEventArgs e)
|
||||
private void WritableContainer_ItemContentChanged(object sender, LibraryItemChangedEventArgs e)
|
||||
{
|
||||
if (items.Where(i => i.Model.ID == e.LibraryItem.ID).FirstOrDefault() is ListViewItem listViewItem)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue