Making library containers use safe lists

This commit is contained in:
Lars Brubaker 2021-04-29 15:59:57 -07:00
parent 3425b63f98
commit f65c278eb2
21 changed files with 88 additions and 74 deletions

View file

@ -1,5 +1,6 @@
/*
Copyright (c) 2018, John Lewin
Copyright (c) 2021 Lars Brubaker
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -29,10 +30,9 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
namespace MatterHackers.MatterControl.Library
{
@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl.Library
public Type DefaultView { get; protected set; }
public List<ILibraryContainerLink> ChildContainers { get; set; } = new List<ILibraryContainerLink>();
public SafeList<ILibraryContainerLink> ChildContainers { get; set; } = new SafeList<ILibraryContainerLink>();
public bool IsProtected { get; protected set; } = true;
@ -57,7 +57,7 @@ namespace MatterHackers.MatterControl.Library
return Task.FromResult<ImageBuffer>(null);
}
public List<ILibraryItem> Items { get; set; } = new List<ILibraryItem>();
public SafeList<ILibraryItem> Items { get; set; } = new SafeList<ILibraryItem>();
public ILibraryContainer Parent { get; set; }