2019-11-08 15:10:05 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Cms.Core.Models
|
2019-11-08 15:10:05 +01:00
|
|
|
{
|
2019-11-13 12:04:50 +11:00
|
|
|
public interface IPropertyCollection : IEnumerable<IProperty>, IDeepCloneable, INotifyCollectionChanged
|
2019-11-08 15:10:05 +01:00
|
|
|
{
|
2022-02-09 13:24:35 +01:00
|
|
|
bool TryGetValue(string propertyTypeAlias, out IProperty? property);
|
2019-11-08 15:10:05 +01:00
|
|
|
bool Contains(string key);
|
|
|
|
|
|
2019-11-13 12:04:50 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Ensures that the collection contains properties for the specified property types.
|
|
|
|
|
/// </summary>
|
2019-11-08 15:10:05 +01:00
|
|
|
void EnsurePropertyTypes(IEnumerable<IPropertyType> propertyTypes);
|
2019-11-13 12:04:50 +11:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Ensures that the collection does not contain properties not in the specified property types.
|
|
|
|
|
/// </summary>
|
2019-11-11 08:36:27 +01:00
|
|
|
void EnsureCleanPropertyTypes(IEnumerable<IPropertyType> propertyTypes);
|
2019-11-08 15:10:05 +01:00
|
|
|
|
2019-11-13 12:04:50 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property with the specified alias.
|
|
|
|
|
/// </summary>
|
2022-02-09 13:24:35 +01:00
|
|
|
IProperty? this[string name] { get; }
|
2019-11-13 12:04:50 +11:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the property at the specified index.
|
|
|
|
|
/// </summary>
|
2022-02-09 13:24:35 +01:00
|
|
|
IProperty? this[int index] { get; }
|
2019-11-13 12:04:50 +11:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds or updates a property.
|
|
|
|
|
/// </summary>
|
2019-11-08 15:10:05 +01:00
|
|
|
void Add(IProperty property);
|
|
|
|
|
|
|
|
|
|
int Count { get; }
|
2021-01-18 15:40:22 +01:00
|
|
|
void ClearCollectionChangedEvents();
|
2019-11-08 15:10:05 +01:00
|
|
|
}
|
|
|
|
|
}
|