diff options
author | Jie Luo <anandolee@gmail.com> | 2015-05-29 17:19:46 -0700 |
---|---|---|
committer | Jie Luo <anandolee@gmail.com> | 2015-05-29 17:19:46 -0700 |
commit | 802e1848ada7d95e867b178314ee89629680c771 (patch) | |
tree | d33bc7c6b42955601e290909e47bcb273292b30d /csharp/src/ProtocolBuffers/GeneratedMessage.cs | |
parent | 252daef02beb27dfb271af8c191102bd24ffd3e3 (diff) | |
parent | f7b417ddfe63cb4d39775e5fd4560894cc547d65 (diff) | |
download | protobuf-802e1848ada7d95e867b178314ee89629680c771.tar.gz protobuf-802e1848ada7d95e867b178314ee89629680c771.tar.bz2 protobuf-802e1848ada7d95e867b178314ee89629680c771.zip |
Merge pull request #404 from anandolee/master
Add oneof support for c#
Diffstat (limited to 'csharp/src/ProtocolBuffers/GeneratedMessage.cs')
-rw-r--r-- | csharp/src/ProtocolBuffers/GeneratedMessage.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/csharp/src/ProtocolBuffers/GeneratedMessage.cs b/csharp/src/ProtocolBuffers/GeneratedMessage.cs index c17c15cf..ff3a0c2a 100644 --- a/csharp/src/ProtocolBuffers/GeneratedMessage.cs +++ b/csharp/src/ProtocolBuffers/GeneratedMessage.cs @@ -142,6 +142,16 @@ namespace Google.ProtocolBuffers get { return Dictionaries.AsReadOnly(GetMutableFieldMap()); }
}
+ public override bool HasOneof(OneofDescriptor oneof)
+ {
+ return InternalFieldAccessors.Oneof(oneof).Has(ThisMessage);
+ }
+
+ public override FieldDescriptor OneofFieldDescriptor(OneofDescriptor oneof)
+ {
+ return InternalFieldAccessors.Oneof(oneof).GetOneofFieldDescriptor(ThisMessage);
+ }
+
public override bool HasField(FieldDescriptor field)
{
return InternalFieldAccessors[field].Has(ThisMessage);
|