Class ExtensionRegistry
Provides extensions to messages while parsing. This API is experimental and subject to change.
Inheritance
Implements
Inherited Members
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
Methods
Add(Extension)
Adds the specified extension to the registry
Declaration
public void Add(Extension extension)
Parameters
Type | Name | Description |
---|---|---|
Extension | extension |
Implements
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
Clone()
Clones the registry into a new registry
Declaration
public ExtensionRegistry Clone()
Returns
Type | Description |
---|---|
ExtensionRegistry |
Implements
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
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
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 |
|
Implements
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
ICollection<Extension>.IsReadOnly
Returns whether the registry is readonly
Declaration
bool ICollection<Extension>.IsReadOnly { get; }
Returns
Type | Description |
---|---|
System.Boolean |
Implements
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |