StyleSheetList
A collection of CSS elements.
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace AngleSharp.Dom
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
internal sealed class StyleSheetList : IStyleSheetList, IEnumerable<IStyleSheet>, IEnumerable
{
private readonly IEnumerable<IStyleSheet> _sheets;
[System.Runtime.CompilerServices.Nullable(2)]
public IStyleSheet this[int index] {
[System.Runtime.CompilerServices.NullableContext(2)]
get {
return _sheets.Skip(index).FirstOrDefault();
}
}
public int Length => _sheets.Count();
internal StyleSheetList(IEnumerable<IStyleSheet> sheets)
{
_sheets = sheets;
}
public IEnumerator<IStyleSheet> GetEnumerator()
{
return _sheets.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}