Class DescriptorBase (3.23.0)

public abstract class DescriptorBase : IDescriptor

Base class for nearly all descriptors, providing common functionality.

Inheritance

object > DescriptorBase

Implements

IDescriptor

Namespace

Google.Protobuf.Reflection

Assembly

Google.Protobuf.dll

Properties

Declaration

public DescriptorDeclaration Declaration { get; }

The declaration information about the descriptor, or null if no declaration information is available for this descriptor.

Property Value
TypeDescription
DescriptorDeclaration
Remarks

This information is typically only available for dynamically loaded descriptors, for example within a protoc plugin where the full descriptors, including source info, are passed to the code by protoc.

File

public FileDescriptor File { get; }
Property Value
TypeDescription
FileDescriptor

The file this descriptor was declared in.

FullName

public string FullName { get; }

The fully qualified name of the descriptor's target.

Property Value
TypeDescription
string

Index

public int Index { get; }
Property Value
TypeDescription
int

The index of this descriptor within its parent descriptor.

Remarks

This returns the index of this descriptor within its parent, for this descriptor's type. (There can be duplicate values for different types, e.g. one enum type with index 0 and one message type with index 0.)

Name

public abstract string Name { get; }

Returns the name of the entity (field, message etc) being described.

Property Value
TypeDescription
string