Class ExtensionRegistry (3.27.1)

public sealed class ExtensionRegistry : ICollection<Extension>, IEnumerable<Extension>, IEnumerable, 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
Type Description
int

Methods

Add(Extension)

public void Add(Extension extension)

Adds the specified extension to the registry

Parameter
Name Description
extension Extension

AddRange(IEnumerable<Extension>)

public void AddRange(IEnumerable<Extension> extensions)

Adds the specified extensions to the registry

Parameter
Name Description
extensions IEnumerableExtension

Clear()

public void Clear()

Clears the registry of all values

Clone()

public ExtensionRegistry Clone()

Clones the registry into a new registry

Returns
Type Description
ExtensionRegistry

Contains(Extension)

public bool Contains(Extension item)

Gets whether the extension registry contains the specified extension

Parameter
Name Description
item Extension
Returns
Type Description
bool

GetEnumerator()

public IEnumerator<Extension> GetEnumerator()

Returns an enumerator to enumerate through the items in the registry

Returns
Type Description
IEnumeratorExtension

Returns an enumerator for the extensions in this registry

Remove(Extension)

public bool Remove(Extension item)

Removes the specified extension from the set

Parameter
Name Description
item Extension

The extension

Returns
Type Description
bool

true if the extension was removed, otherwise false