Show / Hide Table of Contents

Class BaseBrowsingServiceBuilder<T>

Base Service Builder.

Inheritance
System.Object
BaseBrowsingServiceBuilder<T>
ManagedBrowsingServiceBuilder
UnmanagedBrowsingServiceBuilder
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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

A IBrowsingCache.

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 value is a null reference.

SetClient(IBrowsingClient, Boolean)

Set Client.

Declaration
public T SetClient(IBrowsingClient value, bool ownClient)
Parameters
Type Name Description
IBrowsingClient value

A IBrowsingClient.

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 value is a null reference.

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 apiKey is a null reference.

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.

Back to top Generated by DocFX