Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
bdc6cd1d
Commit
bdc6cd1d
authored
Aug 13, 2019
by
Sydney Acksman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose Extension field in FieldDescriptor
parent
6da14fa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
FieldDescriptor.cs
csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
+18
-15
No files found.
csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
View file @
bdc6cd1d
...
...
@@ -66,7 +66,10 @@ namespace Google.Protobuf.Reflection
internal
FieldDescriptorProto
Proto
{
get
;
}
internal
Extension
Extension
{
get
;
}
/// <summary>
/// An extension identifier for this field, or <c>null</c> if this field isn't an extension.
/// </summary>
public
Extension
Extension
{
get
;
}
internal
FieldDescriptor
(
FieldDescriptorProto
proto
,
FileDescriptor
file
,
MessageDescriptor
parent
,
int
index
,
string
propertyName
,
Extension
extension
)
...
...
@@ -201,19 +204,19 @@ namespace Google.Protobuf.Reflection
/// <summary>
/// Returns <c>true</c> if this field is a packed, repeated field; <c>false</c> otherwise.
/// </summary>
public
bool
IsPacked
{
get
{
if
(
File
.
Syntax
!=
Syntax
.
Proto3
)
{
return
Proto
.
Options
?.
Packed
??
false
;
}
else
{
return
!
Proto
.
Options
.
HasPacked
||
Proto
.
Options
.
Packed
;
}
}
public
bool
IsPacked
{
get
{
if
(
File
.
Syntax
!=
Syntax
.
Proto3
)
{
return
Proto
.
Options
?.
Packed
??
false
;
}
else
{
return
!
Proto
.
Options
.
HasPacked
||
Proto
.
Options
.
Packed
;
}
}
}
/// <summary>
...
...
@@ -393,7 +396,7 @@ namespace Google.Protobuf.Reflection
}
private
IFieldAccessor
CreateAccessor
()
{
{
if
(
Extension
!=
null
)
{
return
new
ExtensionAccessor
(
this
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment