Class BaseBrowsingServiceBuilder<T>
Base Service Builder.
Inheritance
Inherited Members
Namespace: Gee.External.Browsing.Services
Assembly: Gee.External.Browsing.dll
Syntax
public abstract class BaseBrowsingServiceBuilder<T>
where T : BaseBrowsingServiceBuilder<T>
Type Parameters
Name | Description |
---|---|
T | The service builder's type. |
Methods
SetCache(IBrowsingCache, Boolean)
Set Cache.
Declaration
public T SetCache(IBrowsingCache value, bool ownCache)
Parameters
Type | Name | Description |
---|---|---|
IBrowsingCache | value | |
System.Boolean | ownCache | A boolean flag indicating whether or not the BaseBrowsingService takes ownership of the cache and disposes it when the service itself is disposed. If the service takes ownership of the cache and you reference or dispose the cache after you create the service, the behavior of the service and the cache is undefined. |
Returns
Type | Description |
---|---|
T | This service builder. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
SetClient(IBrowsingClient, Boolean)
Set Client.
Declaration
public T SetClient(IBrowsingClient value, bool ownClient)
Parameters
Type | Name | Description |
---|---|---|
IBrowsingClient | value | |
System.Boolean | ownClient | A boolean flag indicating whether or not the BaseBrowsingService takes ownership of the client and disposes it when the service itself is disposed. If the service takes ownership of the client and you reference or dispose the client after you create the service, the behavior of the service and the client is undefined. |
Returns
Type | Description |
---|---|
T | This service builder. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
UseHttpClient(String)
Use a HTTP Client.
Declaration
public T UseHttpClient(string apiKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | apiKey | A Google Safe Browsing API key to authenticate to the Google Safe Browsing API with. |
Returns
Type | Description |
---|---|
T | This service builder. |
Remarks
Use an HttpBrowsingClient to communicate with the Google Safe Browsing API. The BaseBrowsingService takes ownership of the HTTP client and will dispose it when the service itself is disposed.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
UseMemoryCache()
Use a Memory Cache.
Declaration
public T UseMemoryCache()
Returns
Type | Description |
---|---|
T | This service builder. |
Remarks
Use a MemoryBrowsingCache to cache a threat that is looked up on the Google Safe Browsing API. The BaseBrowsingService takes ownership off the memory cache and will dispose it when the service itself is disposed.