Configuration.AddService
Contents
[
Hide
]
Configuration.AddService<TService> method
Adds the specified service to the configuration.
public void AddService<TService>(TService service)
where TService : class, IService
Parameter | Description |
---|---|
TService | The type of service to add. |
service | An instance of the service to add. |
Remarks
You can download the complete examples and data files from GitHub.
Examples
using Aspose.Html;
using Aspose.Html.Net;
using Aspose.Html.Services;
public void AddCustomService(){
var customConfiguration = new Configuration();
customConfiguration.AddService<INetworkService>(new CustomNetworkService());
}
class CustomNetworkService : INetworkService
{
public CustomNetworkService()
{
MessageHandlers = new MessageHandlerCollection();
}
public void Dispose()
{
// Resource cleaning code goes here
}
// TODO Override Resolve(...) method
public UrlResolver UrlResolver { get; set; }
public MessageHandlerCollection MessageHandlers { get; private set; }
}
See Also
- interface IService
- class Configuration
- namespace Aspose.Html
- assembly Aspose.HTML