StylingService
Provides the basic set of functionality for retrieving style engines.
using AngleSharp.Extensions;
using AngleSharp.Services.Styling;
using System.Collections.Generic;
namespace AngleSharp.Services.Default
{
public class StylingService : IStylingProvider
{
private readonly List<IStyleEngine> _engines;
public StylingService()
{
_engines = new List<IStyleEngine>();
}
public virtual void Register(IStyleEngine engine)
{
_engines.Add(engine);
}
public virtual void Unregister(IStyleEngine engine)
{
_engines.Remove(engine);
}
public virtual IStyleEngine GetEngine(string mimeType)
{
foreach (IStyleEngine engine in _engines) {
if (engine.Type.Isi(mimeType))
return engine;
}
return null;
}
}
}