Show / Hide Table of Contents

Class ExtensionRegistry

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

Inheritance
System.Object
ExtensionRegistry
Implements
System.Collections.Generic.ICollection<Extension>
System.Collections.Generic.IEnumerable<Extension>
System.Collections.IEnumerable
IDeepCloneable<ExtensionRegistry>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Protobuf
Assembly: Google.Protobuf.dll
Syntax
public sealed class ExtensionRegistry : ICollection<Extension>, IEnumerable<Extension>, IEnumerable, IDeepCloneable<ExtensionRegistry>

Constructors

ExtensionRegistry()

Creates a new empty extension registry

Declaration
public ExtensionRegistry()

Properties

Count

Gets the total number of extensions in this extension registry

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
Implements
System.Collections.Generic.ICollection<T>.Count

Methods

Add(Extension)

Adds the specified extension to the registry

Declaration
public void Add(Extension extension)
Parameters
Type Name Description
Extension extension
Implements
System.Collections.Generic.ICollection<T>.Add(T)

AddRange(IEnumerable<Extension>)

Adds the specified extensions to the reigstry

Declaration
public void AddRange(IEnumerable<Extension> extensions)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Extension> extensions

Clear()

Clears the registry of all values

Declaration
public void Clear()
Implements
System.Collections.Generic.ICollection<T>.Clear()

Clone()

Clones the registry into a new registry

Declaration
public ExtensionRegistry Clone()
Returns
Type Description
ExtensionRegistry
Implements
IDeepCloneable<T>.Clone()

Contains(Extension)

Gets whether the extension registry contains the specified extension

Declaration
public bool Contains(Extension item)
Parameters
Type Name Description
Extension item
Returns
Type Description
System.Boolean
Implements
System.Collections.Generic.ICollection<T>.Contains(T)

GetEnumerator()

Returns an enumerator to enumerate through the items in the registry

Declaration
public IEnumerator<Extension> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<Extension>

Returns an enumerator for the extensions in this registry

Implements
System.Collections.Generic.IEnumerable<T>.GetEnumerator()

Remove(Extension)

Removes the specified extension from the set

Declaration
public bool Remove(Extension item)
Parameters
Type Name Description
Extension item

The extension

Returns
Type Description
System.Boolean

true if the extension was removed, otherwise false

Implements
System.Collections.Generic.ICollection<T>.Remove(T)

Explicit Interface Implementations

ICollection<Extension>.CopyTo(Extension[], Int32)

Copies the arrays in the registry set to the specified array at the specified index

Declaration
void ICollection<Extension>.CopyTo(Extension[] array, int arrayIndex)
Parameters
Type Name Description
Extension[] array

The array to copy to

System.Int32 arrayIndex

The array index to start at

Implements
System.Collections.Generic.ICollection<T>.CopyTo(T[], System.Int32)

ICollection<Extension>.IsReadOnly

Returns whether the registry is readonly

Declaration
bool ICollection<Extension>.IsReadOnly { get; }
Returns
Type Description
System.Boolean
Implements
System.Collections.Generic.ICollection<T>.IsReadOnly

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator
Implements
System.Collections.IEnumerable.GetEnumerator()
Back to top