Rename ILibaryContainer.DefaultView to .ViewOverride

- Ensure the naming more closely matches the behavior
- Mechanism is used by PrintHistory to enforce custom view override
This commit is contained in:
John Lewin 2022-09-13 17:08:17 -07:00
parent 0464f21b9e
commit 8193319188
5 changed files with 8 additions and 5 deletions

View file

@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl
public bool IsProtected => _libraryContainer.IsProtected;
public Type DefaultView => _libraryContainer.DefaultView;
public Type ViewOverride => _libraryContainer.ViewOverride;
public SafeList<ILibraryContainerLink> ChildContainers => new SafeList<ILibraryContainerLink>(this.ExtraContainers.Concat(_libraryContainer.ChildContainers));

View file

@ -59,7 +59,10 @@ namespace MatterHackers.MatterControl.Library
LibrarySortBehavior DefaultSort { get; }
Type DefaultView { get; }
/// <summary>
/// Allows a container to override defaults and user preferences, to display a custom view type when constructed
/// </summary>
Type ViewOverride { get; }
string ID { get; }

View file

@ -46,7 +46,7 @@ namespace MatterHackers.MatterControl.Library
public string CollectionKeyName { get; set; }
public Type DefaultView { get; protected set; }
public Type ViewOverride { get; protected set; }
public SafeList<ILibraryContainerLink> ChildContainers { get; set; } = new SafeList<ILibraryContainerLink>();

View file

@ -45,7 +45,7 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers = new SafeList<ILibraryContainerLink>();
this.Items = new SafeList<ILibraryItem>();
this.Name = "Print History".Localize();
this.DefaultView = typeof(HistoryListView);
this.ViewOverride = typeof(HistoryListView);
PrintHistoryData.Instance.HistoryCleared.RegisterEvent(HistoryChanged, ref unregisterEvents);
ApplicationController.Instance.AnyPrintStarted += HistoryChanged;

View file

@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl.Library
public ILibraryContainer Parent { get; set; } = null;
public Type DefaultView { get; } = null;
public Type ViewOverride { get; } = null;
public string ID { get; } = "rootLibraryProvider";