Class DescriptorBase (3.15.8)

public abstract class DescriptorBase : object, 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
Int32

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