using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
namespace Umbraco.Cms.Core.Models;
public interface IPropertyCollection : IEnumerable<IProperty>, IDeepCloneable, INotifyCollectionChanged
{
int Count { get; }
/// <summary>
/// Gets the property with the specified alias.
/// </summary>
IProperty? this[string name] { get; }
/// Gets the property at the specified index.
IProperty? this[int index] { get; }
bool TryGetValue(string propertyTypeAlias, [MaybeNullWhen(false)] out IProperty property);
bool Contains(string key);
/// Ensures that the collection contains properties for the specified property types.
void EnsurePropertyTypes(IEnumerable<IPropertyType> propertyTypes);
/// Ensures that the collection does not contain properties not in the specified property types.
void EnsureCleanPropertyTypes(IEnumerable<IPropertyType> propertyTypes);
/// Adds or updates a property.
void Add(IProperty property);
void ClearCollectionChangedEvents();
}