Class ExtensionRegistry

public sealed class ExtensionRegistry : ICollection<Extension>, IDeepCloneable<ExtensionRegistry>

Provides extensions to messages while parsing. This API is experimental and subject to change.

Inheritance

Object > ExtensionRegistry

Namespace

Google.Protobuf

Assembly

Google.Protobuf.dll

Constructors

ExtensionRegistry()

public ExtensionRegistry()

Creates a new empty extension registry

Properties

Count

public int Count { get; }

Gets the total number of extensions in this extension registry

Property Value
TypeDescription
Int32

Methods

Add(Extension)

public void Add(Extension extension)

Adds the specified extension to the registry

Parameter
TypeNameDescription
Extensionextension

AddRange(IEnumerable<Extension>)

public void AddRange(IEnumerable<Extension> extensions)

Adds the specified extensions to the registry

Parameter
TypeNameDescription
IEnumerable<Extension>extensions

Clear()

public void Clear()

Clears the registry of all values

Clone()

public ExtensionRegistry Clone()

Clones the registry into a new registry

Returns
TypeDescription
ExtensionRegistry

Contains(Extension)

public bool Contains(Extension item)

Gets whether the extension registry contains the specified extension

Parameter
TypeNameDescription
Extensionitem
Returns
TypeDescription
Boolean

GetEnumerator()

public IEnumerator<Extension> GetEnumerator()

Returns an enumerator to enumerate through the items in the registry

Returns
TypeDescription
IEnumerator<Extension>

Returns an enumerator for the extensions in this registry

Remove(Extension)

public bool Remove(Extension item)

Removes the specified extension from the set

Parameter
TypeNameDescription
Extensionitem

The extension

Returns
TypeDescription
Boolean

true if the extension was removed, otherwise false

Implements