Class ExtensionRegistry (3.15.8)

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
NameDescription
extensionExtension

AddRange(IEnumerable<Extension>)

public void AddRange(IEnumerable<Extension> extensions)

Adds the specified extensions to the registry

Parameter
NameDescription
extensionsIEnumerable<Extension>

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
NameDescription
itemExtension
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
NameDescription
itemExtension

The extension

Returns
TypeDescription
Boolean

true if the extension was removed, otherwise false