Commit 27bfcc5e authored by csharptest's avatar csharptest Committed by rogerk

Slight refactoring of Extensions to support lookup by name, added compatibility…

Slight refactoring of Extensions to support lookup by name, added compatibility tests for text and binary formats.
parent 45a93fad
......@@ -38,6 +38,7 @@
<Protos Include="$(ProtosDirectory)\extest\unittest_extras_full.proto" />
<Protos Include="$(ProtosDirectory)\extest\unittest_extras_lite.proto" />
<Protos Include="$(ProtosDirectory)\extest\unittest_extras_xmltest.proto" />
<Protos Include="$(ProtosDirectory)\extest\unittest_generic_services.proto" />
<Protos Include="$(ProtosDirectory)\extest\unittest_rpc_interop.proto" />
<Protos Include="$(ProtosDirectory)\google\protobuf\descriptor.proto" />
......@@ -54,6 +55,8 @@
<Protos Include="$(ProtosDirectory)\google\protobuf\unittest_mset.proto" />
<Protos Include="$(ProtosDirectory)\google\protobuf\unittest_no_generic_services.proto" />
<Protos Include="$(ProtosDirectory)\google\protobuf\unittest_optimize_for.proto" />
<Protos Include="$(ProtosDirectory)\google\test\google_size.proto" />
<Protos Include="$(ProtosDirectory)\google\test\google_speed.proto" />
<!-- Main protos -->
<GeneratedSource Include="$(BuildTempDirectory)\CSharpOptions.cs">
......@@ -68,6 +71,9 @@
<TargetDirectory>$(SourceDirectory)\AddressBook</TargetDirectory>
</GeneratedSource>
<!-- Unit test -->
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestXmlSerializerTestProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffers.Test\TestProtos</TargetDirectory>
</GeneratedSource>
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestCSharpOptionsProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffers.Test\TestProtos</TargetDirectory>
</GeneratedSource>
......@@ -108,6 +114,9 @@
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestExtrasFullProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos</TargetDirectory>
</GeneratedSource>
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestExtrasLiteProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos</TargetDirectory>
</GeneratedSource>
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestImportLiteProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos</TargetDirectory>
</GeneratedSource>
......@@ -123,6 +132,12 @@
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffersLite.Test\TestProtos</TargetDirectory>
</GeneratedSource>
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestGoogleSizeProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffers.Test\TestProtos</TargetDirectory>
</GeneratedSource>
<GeneratedSource Include="$(BuildTempDirectory)\UnitTestGoogleSpeedProtoFile.cs">
<TargetDirectory>$(SourceDirectory)\ProtocolBuffers.Test\TestProtos</TargetDirectory>
</GeneratedSource>
<TestContainer Include="$(SourceDirectory)\ProtocolBuffers.Test\bin\$(BuildConfiguration)\Google.ProtocolBuffers.Test.dll" />
<TestContainer Include="$(SourceDirectory)\ProtocolBuffersLite.Test\bin\$(BuildConfiguration)\Google.ProtocolBuffersLite.Test.dll" />
......
// Additional options required for C# generation. File from copyright
// line onwards is as per original distribution.
import "google/protobuf/csharp_options.proto";
option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos";
option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestXmlSerializerTestProtoFile";
package protobuf_unittest_extra;
option optimize_for = SPEED;
enum EnumOptions {
ONE = 0;
TWO = 1;
THREE = 2;
}
message TestXmlChild
{
repeated EnumOptions options = 3;
optional bytes binary = 4;
}
message TestXmlNoFields {
}
message TestXmlMessage {
optional int64 number = 6;
repeated int32 numbers = 2;
optional string text = 3;
repeated string textlines = 700;
optional bool valid = 5;
optional TestXmlChild child = 1;
repeated group Children = 401
{
repeated EnumOptions options = 3;
optional bytes binary = 4;
}
extensions 100 to 199;
}
message TestXmlExtension {
required int32 number = 1;
}
extend TestXmlMessage {
optional EnumOptions extension_enum = 101;
optional string extension_text = 102;
repeated int32 extension_number = 103 [packed = true];
optional TestXmlExtension extension_message = 199;
}
package benchmarks;
import "google/protobuf/csharp_options.proto";
option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos";
option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGoogleSizeProtoFile";
option java_outer_classname = "GoogleSize";
option optimize_for = CODE_SIZE;
message SizeMessage1 {
required string field1 = 1;
optional string field9 = 9;
optional string field18 = 18;
optional bool field80 = 80 [default=false];
optional bool field81 = 81 [default=true];
required int32 field2 = 2;
required int32 field3 = 3;
optional int32 field280 = 280;
optional int32 field6 = 6 [default=0];
optional int64 field22 = 22;
optional string field4 = 4;
repeated fixed64 field5 = 5;
optional bool field59 = 59 [default=false];
optional string field7 = 7;
optional int32 field16 = 16;
optional int32 field130 = 130 [default=0];
optional bool field12 = 12 [default=true];
optional bool field17 = 17 [default=true];
optional bool field13 = 13 [default=true];
optional bool field14 = 14 [default=true];
optional int32 field104 = 104 [default=0];
optional int32 field100 = 100 [default=0];
optional int32 field101 = 101 [default=0];
optional string field102 = 102;
optional string field103 = 103;
optional int32 field29 = 29 [default=0];
optional bool field30 = 30 [default=false];
optional int32 field60 = 60 [default=-1];
optional int32 field271 = 271 [default=-1];
optional int32 field272 = 272 [default=-1];
optional int32 field150 = 150;
optional int32 field23 = 23 [default=0];
optional bool field24 = 24 [default=false];
optional int32 field25 = 25 [default=0];
optional SizeMessage1SubMessage field15 = 15;
optional bool field78 = 78;
optional int32 field67 = 67 [default=0];
optional int32 field68 = 68;
optional int32 field128 = 128 [default=0];
optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"];
optional int32 field131 = 131 [default=0];
}
message SizeMessage1SubMessage {
optional int32 field1 = 1 [default=0];
optional int32 field2 = 2 [default=0];
optional int32 field3 = 3 [default=0];
optional string field15 = 15;
optional bool field12 = 12 [default=true];
optional int64 field13 = 13;
optional int64 field14 = 14;
optional int32 field16 = 16;
optional int32 field19 = 19 [default=2];
optional bool field20 = 20 [default=true];
optional bool field28 = 28 [default=true];
optional fixed64 field21 = 21;
optional int32 field22 = 22;
optional bool field23 = 23 [ default=false ];
optional bool field206 = 206 [default=false];
optional fixed32 field203 = 203;
optional int32 field204 = 204;
optional string field205 = 205;
optional uint64 field207 = 207;
optional uint64 field300 = 300;
}
message SizeMessage2 {
optional string field1 = 1;
optional int64 field3 = 3;
optional int64 field4 = 4;
optional int64 field30 = 30;
optional bool field75 = 75 [default=false];
optional string field6 = 6;
optional bytes field2 = 2;
optional int32 field21 = 21 [default=0];
optional int32 field71 = 71;
optional float field25 = 25;
optional int32 field109 = 109 [default=0];
optional int32 field210 = 210 [default=0];
optional int32 field211 = 211 [default=0];
optional int32 field212 = 212 [default=0];
optional int32 field213 = 213 [default=0];
optional int32 field216 = 216 [default=0];
optional int32 field217 = 217 [default=0];
optional int32 field218 = 218 [default=0];
optional int32 field220 = 220 [default=0];
optional int32 field221 = 221 [default=0];
optional float field222 = 222 [default=0.0];
optional int32 field63 = 63;
repeated group Group1 = 10 {
required float field11 = 11;
optional float field26 = 26;
optional string field12 = 12;
optional string field13 = 13;
repeated string field14 = 14;
required uint64 field15 = 15;
optional int32 field5 = 5;
optional string field27 = 27;
optional int32 field28 = 28;
optional string field29 = 29;
optional string field16 = 16;
repeated string field22 = 22;
repeated int32 field73 = 73;
optional int32 field20 = 20 [default=0];
optional string field24 = 24;
optional SizeMessage2GroupedMessage field31 = 31;
}
repeated string field128 = 128;
optional int64 field131 = 131;
repeated string field127 = 127;
optional int32 field129 = 129;
repeated int64 field130 = 130;
optional bool field205 = 205 [default=false];
optional bool field206 = 206 [default=false];
}
message SizeMessage2GroupedMessage {
optional float field1 = 1;
optional float field2 = 2;
optional float field3 = 3 [default=0.0];
optional bool field4 = 4;
optional bool field5 = 5;
optional bool field6 = 6 [default=true];
optional bool field7 = 7 [default=false];
optional float field8 = 8;
optional bool field9 = 9;
optional float field10 = 10;
optional int64 field11 = 11;
}
package benchmarks;
import "google/protobuf/csharp_options.proto";
option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos";
option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGoogleSpeedProtoFile";
option java_outer_classname = "GoogleSpeed";
option optimize_for = SPEED;
message SpeedMessage1 {
required string field1 = 1;
optional string field9 = 9;
optional string field18 = 18;
optional bool field80 = 80 [default=false];
optional bool field81 = 81 [default=true];
required int32 field2 = 2;
required int32 field3 = 3;
optional int32 field280 = 280;
optional int32 field6 = 6 [default=0];
optional int64 field22 = 22;
optional string field4 = 4;
repeated fixed64 field5 = 5;
optional bool field59 = 59 [default=false];
optional string field7 = 7;
optional int32 field16 = 16;
optional int32 field130 = 130 [default=0];
optional bool field12 = 12 [default=true];
optional bool field17 = 17 [default=true];
optional bool field13 = 13 [default=true];
optional bool field14 = 14 [default=true];
optional int32 field104 = 104 [default=0];
optional int32 field100 = 100 [default=0];
optional int32 field101 = 101 [default=0];
optional string field102 = 102;
optional string field103 = 103;
optional int32 field29 = 29 [default=0];
optional bool field30 = 30 [default=false];
optional int32 field60 = 60 [default=-1];
optional int32 field271 = 271 [default=-1];
optional int32 field272 = 272 [default=-1];
optional int32 field150 = 150;
optional int32 field23 = 23 [default=0];
optional bool field24 = 24 [default=false];
optional int32 field25 = 25 [default=0];
optional SpeedMessage1SubMessage field15 = 15;
optional bool field78 = 78;
optional int32 field67 = 67 [default=0];
optional int32 field68 = 68;
optional int32 field128 = 128 [default=0];
optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"];
optional int32 field131 = 131 [default=0];
}
message SpeedMessage1SubMessage {
optional int32 field1 = 1 [default=0];
optional int32 field2 = 2 [default=0];
optional int32 field3 = 3 [default=0];
optional string field15 = 15;
optional bool field12 = 12 [default=true];
optional int64 field13 = 13;
optional int64 field14 = 14;
optional int32 field16 = 16;
optional int32 field19 = 19 [default=2];
optional bool field20 = 20 [default=true];
optional bool field28 = 28 [default=true];
optional fixed64 field21 = 21;
optional int32 field22 = 22;
optional bool field23 = 23 [ default=false ];
optional bool field206 = 206 [default=false];
optional fixed32 field203 = 203;
optional int32 field204 = 204;
optional string field205 = 205;
optional uint64 field207 = 207;
optional uint64 field300 = 300;
}
message SpeedMessage2 {
optional string field1 = 1;
optional int64 field3 = 3;
optional int64 field4 = 4;
optional int64 field30 = 30;
optional bool field75 = 75 [default=false];
optional string field6 = 6;
optional bytes field2 = 2;
optional int32 field21 = 21 [default=0];
optional int32 field71 = 71;
optional float field25 = 25;
optional int32 field109 = 109 [default=0];
optional int32 field210 = 210 [default=0];
optional int32 field211 = 211 [default=0];
optional int32 field212 = 212 [default=0];
optional int32 field213 = 213 [default=0];
optional int32 field216 = 216 [default=0];
optional int32 field217 = 217 [default=0];
optional int32 field218 = 218 [default=0];
optional int32 field220 = 220 [default=0];
optional int32 field221 = 221 [default=0];
optional float field222 = 222 [default=0.0];
optional int32 field63 = 63;
repeated group Group1 = 10 {
required float field11 = 11;
optional float field26 = 26;
optional string field12 = 12;
optional string field13 = 13;
repeated string field14 = 14;
required uint64 field15 = 15;
optional int32 field5 = 5;
optional string field27 = 27;
optional int32 field28 = 28;
optional string field29 = 29;
optional string field16 = 16;
repeated string field22 = 22;
repeated int32 field73 = 73;
optional int32 field20 = 20 [default=0];
optional string field24 = 24;
optional SpeedMessage2GroupedMessage field31 = 31;
}
repeated string field128 = 128;
optional int64 field131 = 131;
repeated string field127 = 127;
optional int32 field129 = 129;
repeated int64 field130 = 130;
optional bool field205 = 205 [default=false];
optional bool field206 = 206 [default=false];
}
message SpeedMessage2GroupedMessage {
optional float field1 = 1;
optional float field2 = 2;
optional float field3 = 3 [default=0.0];
optional bool field4 = 4;
optional bool field5 = 5;
optional bool field6 = 6 [default=true];
optional bool field7 = 7 [default=false];
optional float field8 = 8;
optional bool field9 = 9;
optional float field10 = 10;
optional int64 field11 = 11;
}
......@@ -133,7 +133,7 @@ namespace Google.ProtocolBuffers.ProtoGen
}
if (UseLiteRuntime && Descriptor.DefaultValue is ByteString)
{
string temp = Convert.ToBase64String(((ByteString) Descriptor.DefaultValue).ToByteArray());
string temp = (((ByteString) Descriptor.DefaultValue).ToBase64());
return String.Format("ByteString.FromBase64(\"{0}\")", temp);
}
return string.Format("(pb::ByteString) {0}.Descriptor.Fields[{1}].DefaultValue",
......
using System;
using NUnit.Framework;
namespace Google.ProtocolBuffers.CompatTests
{
[TestFixture]
public class BinaryCompatibilityTests : CompatibilityTests
{
protected override string TestName { get { return "binary"; } }
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
{
byte[] bresult = message.ToByteArray();
return bresult;
}
protected override TBuilder DeerializeMessage<TMessage, TBuilder>(object message, TBuilder builder, ExtensionRegistry registry)
{
return builder.MergeFrom((byte[])message, registry);
}
}
}
\ No newline at end of file
using System;
using Google.ProtocolBuffers.TestProtos;
using NUnit.Framework;
namespace Google.ProtocolBuffers.CompatTests
{
public abstract class CompatibilityTests
{
protected abstract string TestName { get; }
protected abstract object SerializeMessage<TMessage, TBuilder>(TMessage message)
where TMessage : IMessageLite<TMessage, TBuilder>
where TBuilder : IBuilderLite<TMessage, TBuilder>;
protected abstract TBuilder DeerializeMessage<TMessage, TBuilder>(object message, TBuilder builder, ExtensionRegistry registry)
where TMessage : IMessageLite<TMessage, TBuilder>
where TBuilder : IBuilderLite<TMessage, TBuilder>;
#region RunBenchmark
protected void RunBenchmark<TMessage, TBuilder>(byte[] buffer, bool write)
where TMessage : IMessageLite<TMessage, TBuilder>
where TBuilder : IBuilderLite<TMessage, TBuilder>, new()
{
TBuilder builder = new TBuilder();
TMessage message = new TBuilder().MergeFrom(buffer).Build();
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
//simple warm-up
object content = SerializeMessage<TMessage, TBuilder>(message);
Assert.AreEqual(message, DeerializeMessage<TMessage, TBuilder>(content, new TBuilder(), ExtensionRegistry.Empty).Build());
//timming
long time = 0, sample = 1;
while (time < 100)
{
sample *= 10;
watch.Reset();
watch.Start();
if (write)
{
for (int i = 0; i < sample; i++)
SerializeMessage<TMessage, TBuilder>(message);
}
else
{
for (int i = 0; i < sample; i++)
DeerializeMessage<TMessage, TBuilder>(content, builder, ExtensionRegistry.Empty);
}
watch.Stop();
time = watch.ElapsedMilliseconds;
}
ulong rounds = (ulong)((100.0 / watch.ElapsedMilliseconds) * sample);
//test
watch.Reset();
watch.Start();
if (write)
{
for (ulong i = 0; i < rounds; i++)
SerializeMessage<TMessage, TBuilder>(message);
}
else
{
for (ulong i = 0; i < rounds; i++)
DeerializeMessage<TMessage, TBuilder>(content, builder, ExtensionRegistry.Empty);
}
watch.Stop();
System.Diagnostics.Trace.TraceInformation(
"\r\n{0} {4} {5} {3:n0} rps ({1:n0} rounds in {2:n0} ms)", typeof(TMessage).Name, rounds,
watch.ElapsedMilliseconds, (1000.0 / watch.ElapsedMilliseconds) * (double)rounds, TestName, write ? " write" : " read");
GC.GetTotalMemory(true);
GC.WaitForPendingFinalizers();
}
[Test]
public virtual void Message1OptimizeSizeWriterPerf()
{
RunBenchmark<SizeMessage1, SizeMessage1.Builder>(TestResources.google_message1, true);
}
[Test]
public virtual void Message1OptimizeSpeedWriterPerf()
{
RunBenchmark<SpeedMessage1, SpeedMessage1.Builder>(TestResources.google_message1, true);
}
[Test]
public virtual void Message2OptimizeSizeWriterPerf()
{
RunBenchmark<SizeMessage2, SizeMessage2.Builder>(TestResources.google_message2, true);
}
[Test]
public virtual void Message2OptimizeSpeedWriterPerf()
{
RunBenchmark<SpeedMessage2, SpeedMessage2.Builder>(TestResources.google_message2, true);
}
[Test]
public virtual void Message1OptimizeSizeReadPerf()
{
RunBenchmark<SizeMessage1, SizeMessage1.Builder>(TestResources.google_message1, false);
}
[Test]
public virtual void Message1OptimizeSpeedReadPerf()
{
RunBenchmark<SpeedMessage1, SpeedMessage1.Builder>(TestResources.google_message1, false);
}
[Test]
public virtual void Message2OptimizeSizeReadPerf()
{
RunBenchmark<SizeMessage2, SizeMessage2.Builder>(TestResources.google_message2, false);
}
[Test]
public virtual void Message2OptimizeSpeedReadPerf()
{
RunBenchmark<SpeedMessage2, SpeedMessage2.Builder>(TestResources.google_message2, false);
}
#endregion
[Test]
public virtual void RoundTripMessage1OptimizeSize()
{
SizeMessage1 msg = SizeMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build();
object content = SerializeMessage<SizeMessage1, SizeMessage1.Builder>(msg);
SizeMessage1 copy = DeerializeMessage<SizeMessage1, SizeMessage1.Builder>(content, SizeMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.AreEqual(content, SerializeMessage<SizeMessage1,SizeMessage1.Builder>(copy));
Assert.AreEqual(TestResources.google_message1, copy.ToByteArray());
}
[Test]
public virtual void RoundTripMessage2OptimizeSize()
{
SizeMessage2 msg = SizeMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build();
object content = SerializeMessage<SizeMessage2, SizeMessage2.Builder>(msg);
SizeMessage2 copy = DeerializeMessage<SizeMessage2, SizeMessage2.Builder>(content, SizeMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.AreEqual(content, SerializeMessage<SizeMessage2, SizeMessage2.Builder>(copy));
Assert.AreEqual(TestResources.google_message2, copy.ToByteArray());
}
[Test]
public virtual void RoundTripMessage1OptimizeSpeed()
{
SpeedMessage1 msg = SpeedMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build();
object content = SerializeMessage<SpeedMessage1, SpeedMessage1.Builder>(msg);
SpeedMessage1 copy = DeerializeMessage<SpeedMessage1, SpeedMessage1.Builder>(content, SpeedMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.AreEqual(content, SerializeMessage<SpeedMessage1, SpeedMessage1.Builder>(copy));
Assert.AreEqual(TestResources.google_message1, copy.ToByteArray());
}
[Test]
public virtual void RoundTripMessage2OptimizeSpeed()
{
SpeedMessage2 msg = SpeedMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build();
object content = SerializeMessage<SpeedMessage2, SpeedMessage2.Builder>(msg);
SpeedMessage2 copy = DeerializeMessage<SpeedMessage2, SpeedMessage2.Builder>(content, SpeedMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.AreEqual(content, SerializeMessage<SpeedMessage2, SpeedMessage2.Builder>(copy));
Assert.AreEqual(TestResources.google_message2, copy.ToByteArray());
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.5444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Google.ProtocolBuffers.CompatTests {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class TestResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal TestResources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.ProtocolBuffers.CompatTests.TestResources", typeof(TestResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static byte[] google_message1 {
get {
object obj = ResourceManager.GetObject("google_message1", resourceCulture);
return ((byte[])(obj));
}
}
internal static byte[] google_message2 {
get {
object obj = ResourceManager.GetObject("google_message2", resourceCulture);
return ((byte[])(obj));
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="google_message1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>google_message1.dat;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="google_message2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>google_message2.dat;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
\ No newline at end of file
using System.ComponentModel;
using System.IO;
using NUnit.Framework;
namespace Google.ProtocolBuffers.CompatTests
{
[TestFixture]
public class TextCompatibilityTests : CompatibilityTests
{
protected override string TestName { get { return "text"; } }
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
{
StringWriter text = new StringWriter();
message.PrintTo(text);
return text.ToString();
}
protected override TBuilder DeerializeMessage<TMessage, TBuilder>(object message, TBuilder builder, ExtensionRegistry registry)
{
TextFormat.Merge(new StringReader((string)message), registry, (IBuilder)builder);
return builder;
}
[Test, Explicit, Description("This test can take a very long time to run.")]
public override void Message2OptimizeSizeReadPerf()
{
base.Message2OptimizeSizeReadPerf();
}
[Test, Explicit, Description("This test can take a very long time to run.")]
public override void Message2OptimizeSpeedReadPerf()
{
base.Message2OptimizeSpeedReadPerf();
}
[Test, Explicit, Description("This test can take a very long time to run.")]
public override void RoundTripMessage2OptimizeSize()
{
base.RoundTripMessage2OptimizeSize();
}
[Test, Explicit, Description("This test can take a very long time to run.")]
public override void RoundTripMessage2OptimizeSpeed()
{
base.RoundTripMessage2OptimizeSpeed();
}
[Test, Explicit, Description("This test can take a very long time to run.")]
public override void Message2OptimizeSizeWriterPerf()
{
base.Message2OptimizeSizeWriterPerf();
}
[Test, Explicit, Description("This test can take a very long time to run.")]
public override void Message2OptimizeSpeedWriterPerf()
{
base.Message2OptimizeSpeedWriterPerf();
}
}
}
\ No newline at end of file
......@@ -34,6 +34,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TrackFileAccess>false</TrackFileAccess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -74,6 +75,14 @@
<Compile Include="CodedInputStreamTest.cs" />
<Compile Include="CodedOutputStreamTest.cs" />
<Compile Include="Collections\PopsicleListTest.cs" />
<Compile Include="CompatTests\BinaryCompatibilityTests.cs" />
<Compile Include="CompatTests\CompatibilityTests.cs" />
<Compile Include="CompatTests\TestResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>TestResources.resx</DependentUpon>
</Compile>
<Compile Include="CompatTests\TextCompatibilityTests.cs" />
<Compile Include="CSharpOptionsTest.cs" />
<Compile Include="DescriptorsTest.cs" />
<Compile Include="Descriptors\MessageDescriptorTest.cs" />
......@@ -93,6 +102,8 @@
<Compile Include="TestProtos\UnitTestEmbedOptimizeForProtoFile.cs" />
<Compile Include="TestProtos\UnitTestEmptyProtoFile.cs" />
<Compile Include="TestProtos\UnitTestGenericServices.cs" />
<Compile Include="TestProtos\UnitTestGoogleSizeProtoFile.cs" />
<Compile Include="TestProtos\UnitTestGoogleSpeedProtoFile.cs" />
<Compile Include="TestProtos\UnitTestImportLiteProtoFile.cs" />
<Compile Include="TestProtos\UnitTestImportProtoFile.cs" />
<Compile Include="TestProtos\UnitTestMessageSetProtoFile.cs" />
......@@ -100,6 +111,7 @@
<Compile Include="TestProtos\UnitTestOptimizeForProtoFile.cs" />
<Compile Include="TestProtos\UnitTestProtoFile.cs" />
<Compile Include="TestProtos\UnitTestRpcInterop.cs" />
<Compile Include="TestProtos\UnitTestXmlSerializerTestProtoFile.cs" />
<Compile Include="TestRpcGenerator.cs" />
<Compile Include="TestUtil.cs" />
<Compile Include="TextFormatTest.cs" />
......@@ -129,6 +141,16 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="CompatTests\google_message1.dat" />
<None Include="CompatTests\google_message2.dat" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="CompatTests\TestResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>TestResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Debug' " />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Release' " />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT!
using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
namespace Google.ProtocolBuffers.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public static partial class UnitTestXmlSerializerTestProtoFile {
#region Extension registration
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionEnum);
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionText);
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionNumber);
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionMessage);
}
#endregion
#region Extensions
public const int ExtensionEnumFieldNumber = 101;
public static pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.EnumOptions> ExtensionEnum;
public const int ExtensionTextFieldNumber = 102;
public static pb::GeneratedExtensionBase<string> ExtensionText;
public const int ExtensionNumberFieldNumber = 103;
public static pb::GeneratedExtensionBase<scg::IList<int>> ExtensionNumber;
public const int ExtensionMessageFieldNumber = 199;
public static pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.TestProtos.TestXmlExtension> ExtensionMessage;
#endregion
#region Static variables
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlChild, global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder> internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable;
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields, global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.Builder> internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable;
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Builder> internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable;
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder> internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable;
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor;
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlExtension, global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.Builder> internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable;
#endregion
#region Descriptor
public static pbd::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbd::FileDescriptor descriptor;
static UnitTestXmlSerializerTestProtoFile() {
byte[] descriptorData = global::System.Convert.FromBase64String(
"CiRleHRlc3QvdW5pdHRlc3RfZXh0cmFzX3htbHRlc3QucHJvdG8SF3Byb3Rv" +
"YnVmX3VuaXR0ZXN0X2V4dHJhGiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29w" +
"dGlvbnMucHJvdG8iVQoMVGVzdFhtbENoaWxkEjUKB29wdGlvbnMYAyADKA4y" +
"JC5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5FbnVtT3B0aW9ucxIOCgZiaW5h" +
"cnkYBCABKAwiEQoPVGVzdFhtbE5vRmllbGRzIrcCCg5UZXN0WG1sTWVzc2Fn" +
"ZRIOCgZudW1iZXIYBiABKAMSDwoHbnVtYmVycxgCIAMoBRIMCgR0ZXh0GAMg" +
"ASgJEhIKCXRleHRsaW5lcxi8BSADKAkSDQoFdmFsaWQYBSABKAgSNAoFY2hp" +
"bGQYASABKAsyJS5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1sQ2hp" +
"bGQSQwoIY2hpbGRyZW4YkQMgAygKMjAucHJvdG9idWZfdW5pdHRlc3RfZXh0" +
"cmEuVGVzdFhtbE1lc3NhZ2UuQ2hpbGRyZW4aUQoIQ2hpbGRyZW4SNQoHb3B0" +
"aW9ucxgDIAMoDjIkLnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLkVudW1PcHRp" +
"b25zEg4KBmJpbmFyeRgEIAEoDCoFCGQQyAEiIgoQVGVzdFhtbEV4dGVuc2lv" +
"bhIOCgZudW1iZXIYASACKAUqKgoLRW51bU9wdGlvbnMSBwoDT05FEAASBwoD" +
"VFdPEAESCQoFVEhSRUUQAjplCg5leHRlbnNpb25fZW51bRInLnByb3RvYnVm" +
"X3VuaXR0ZXN0X2V4dHJhLlRlc3RYbWxNZXNzYWdlGGUgASgOMiQucHJvdG9i" +
"dWZfdW5pdHRlc3RfZXh0cmEuRW51bU9wdGlvbnM6PwoOZXh0ZW5zaW9uX3Rl" +
"eHQSJy5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0WG1sTWVzc2FnZRhm" +
"IAEoCTpFChBleHRlbnNpb25fbnVtYmVyEicucHJvdG9idWZfdW5pdHRlc3Rf" +
"ZXh0cmEuVGVzdFhtbE1lc3NhZ2UYZyADKAVCAhABOm4KEWV4dGVuc2lvbl9t" +
"ZXNzYWdlEicucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFhtbE1lc3Nh" +
"Z2UYxwEgASgLMikucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFhtbEV4" +
"dGVuc2lvbkJMSAHCPkcKIUdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFBy" +
"b3RvcxIiVW5pdFRlc3RYbWxTZXJpYWxpemVyVGVzdFByb3RvRmlsZQ==");
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
descriptor = root;
internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor = Descriptor.MessageTypes[0];
internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable =
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlChild, global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder>(internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor,
new string[] { "Options", "Binary", });
internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor = Descriptor.MessageTypes[1];
internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable =
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields, global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.Builder>(internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor,
new string[] { });
internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor = Descriptor.MessageTypes[2];
internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable =
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Builder>(internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor,
new string[] { "Number", "Numbers", "Text", "Textlines", "Valid", "Child", "Children", });
internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor = internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor.NestedTypes[0];
internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable =
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder>(internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor,
new string[] { "Options", "Binary", });
internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor = Descriptor.MessageTypes[3];
internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable =
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestXmlExtension, global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.Builder>(internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor,
new string[] { "Number", });
global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionEnum = pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.EnumOptions>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[0]);
global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionText = pb::GeneratedSingleExtension<string>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[1]);
global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionNumber = pb::GeneratedRepeatExtension<int>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[2]);
global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.ExtensionMessage = pb::GeneratedSingleExtension<global::Google.ProtocolBuffers.TestProtos.TestXmlExtension>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor.Extensions[3]);
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
RegisterAllExtensions(registry);
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry);
return registry;
};
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbd::FileDescriptor[] {
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
}, assigner);
}
#endregion
}
#region Enums
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public enum EnumOptions {
ONE = 0,
TWO = 1,
THREE = 2,
}
#endregion
#region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class TestXmlChild : pb::GeneratedMessage<TestXmlChild, TestXmlChild.Builder> {
private static readonly TestXmlChild defaultInstance = new Builder().BuildPartial();
public static TestXmlChild DefaultInstance {
get { return defaultInstance; }
}
public override TestXmlChild DefaultInstanceForType {
get { return defaultInstance; }
}
protected override TestXmlChild ThisMessage {
get { return this; }
}
public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlChild__Descriptor; }
}
protected override pb::FieldAccess.FieldAccessorTable<TestXmlChild, TestXmlChild.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlChild__FieldAccessorTable; }
}
public const int OptionsFieldNumber = 3;
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.EnumOptions> options_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.EnumOptions>();
public scg::IList<global::Google.ProtocolBuffers.TestProtos.EnumOptions> OptionsList {
get { return pbc::Lists.AsReadOnly(options_); }
}
public int OptionsCount {
get { return options_.Count; }
}
public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) {
return options_[index];
}
public const int BinaryFieldNumber = 4;
private bool hasBinary;
private pb::ByteString binary_ = pb::ByteString.Empty;
public bool HasBinary {
get { return hasBinary; }
}
public pb::ByteString Binary {
get { return binary_; }
}
public override bool IsInitialized {
get {
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
int size = SerializedSize;
if (options_.Count > 0) {
foreach (int element in options_) {
output.WriteEnum(3, element);
}
}
if (HasBinary) {
output.WriteBytes(4, Binary);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
if (options_.Count > 0) {
foreach (global::Google.ProtocolBuffers.TestProtos.EnumOptions element in options_) {
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 1 * options_.Count;
}
}
if (HasBinary) {
size += pb::CodedOutputStream.ComputeBytesSize(4, Binary);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static TestXmlChild ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlChild ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlChild ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlChild ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlChild ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlChild ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestXmlChild ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestXmlChild ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestXmlChild ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlChild ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Builder CreateBuilder() { return new Builder(); }
public override Builder ToBuilder() { return CreateBuilder(this); }
public override Builder CreateBuilderForType() { return new Builder(); }
public static Builder CreateBuilder(TestXmlChild prototype) {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilder<TestXmlChild, Builder> {
protected override Builder ThisBuilder {
get { return this; }
}
public Builder() {}
TestXmlChild result = new TestXmlChild();
protected override TestXmlChild MessageBeingBuilt {
get { return result; }
}
public override Builder Clear() {
result = new TestXmlChild();
return this;
}
public override Builder Clone() {
return new Builder().MergeFrom(result);
}
public override pbd::MessageDescriptor DescriptorForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Descriptor; }
}
public override TestXmlChild DefaultInstanceForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance; }
}
public override TestXmlChild BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.options_.MakeReadOnly();
TestXmlChild returnMe = result;
result = null;
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is TestXmlChild) {
return MergeFrom((TestXmlChild) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(TestXmlChild other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance) return this;
if (other.options_.Count != 0) {
base.AddRange(other.options_, result.options_);
}
if (other.HasBinary) {
Binary = other.Binary;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
break;
}
case 24: {
int rawValue = input.ReadEnum();
if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.EnumOptions), rawValue)) {
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
unknownFields.MergeVarintField(3, (ulong) rawValue);
} else {
AddOptions((global::Google.ProtocolBuffers.TestProtos.EnumOptions) rawValue);
}
break;
}
case 34: {
Binary = input.ReadBytes();
break;
}
}
}
}
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.EnumOptions> OptionsList {
get { return result.options_; }
}
public int OptionsCount {
get { return result.OptionsCount; }
}
public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) {
return result.GetOptions(index);
}
public Builder SetOptions(int index, global::Google.ProtocolBuffers.TestProtos.EnumOptions value) {
result.options_[index] = value;
return this;
}
public Builder AddOptions(global::Google.ProtocolBuffers.TestProtos.EnumOptions value) {
result.options_.Add(value);
return this;
}
public Builder AddRangeOptions(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.EnumOptions> values) {
base.AddRange(values, result.options_);
return this;
}
public Builder ClearOptions() {
result.options_.Clear();
return this;
}
public bool HasBinary {
get { return result.HasBinary; }
}
public pb::ByteString Binary {
get { return result.Binary; }
set { SetBinary(value); }
}
public Builder SetBinary(pb::ByteString value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.hasBinary = true;
result.binary_ = value;
return this;
}
public Builder ClearBinary() {
result.hasBinary = false;
result.binary_ = pb::ByteString.Empty;
return this;
}
}
static TestXmlChild() {
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class TestXmlNoFields : pb::GeneratedMessage<TestXmlNoFields, TestXmlNoFields.Builder> {
private static readonly TestXmlNoFields defaultInstance = new Builder().BuildPartial();
public static TestXmlNoFields DefaultInstance {
get { return defaultInstance; }
}
public override TestXmlNoFields DefaultInstanceForType {
get { return defaultInstance; }
}
protected override TestXmlNoFields ThisMessage {
get { return this; }
}
public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlNoFields__Descriptor; }
}
protected override pb::FieldAccess.FieldAccessorTable<TestXmlNoFields, TestXmlNoFields.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlNoFields__FieldAccessorTable; }
}
public override bool IsInitialized {
get {
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
int size = SerializedSize;
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static TestXmlNoFields ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlNoFields ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlNoFields ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlNoFields ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlNoFields ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlNoFields ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestXmlNoFields ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestXmlNoFields ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestXmlNoFields ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlNoFields ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Builder CreateBuilder() { return new Builder(); }
public override Builder ToBuilder() { return CreateBuilder(this); }
public override Builder CreateBuilderForType() { return new Builder(); }
public static Builder CreateBuilder(TestXmlNoFields prototype) {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilder<TestXmlNoFields, Builder> {
protected override Builder ThisBuilder {
get { return this; }
}
public Builder() {}
TestXmlNoFields result = new TestXmlNoFields();
protected override TestXmlNoFields MessageBeingBuilt {
get { return result; }
}
public override Builder Clear() {
result = new TestXmlNoFields();
return this;
}
public override Builder Clone() {
return new Builder().MergeFrom(result);
}
public override pbd::MessageDescriptor DescriptorForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.Descriptor; }
}
public override TestXmlNoFields DefaultInstanceForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.DefaultInstance; }
}
public override TestXmlNoFields BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestXmlNoFields returnMe = result;
result = null;
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is TestXmlNoFields) {
return MergeFrom((TestXmlNoFields) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(TestXmlNoFields other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlNoFields.DefaultInstance) return this;
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
break;
}
}
}
}
}
static TestXmlNoFields() {
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class TestXmlMessage : pb::ExtendableMessage<TestXmlMessage, TestXmlMessage.Builder> {
private static readonly TestXmlMessage defaultInstance = new Builder().BuildPartial();
public static TestXmlMessage DefaultInstance {
get { return defaultInstance; }
}
public override TestXmlMessage DefaultInstanceForType {
get { return defaultInstance; }
}
protected override TestXmlMessage ThisMessage {
get { return this; }
}
public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage__Descriptor; }
}
protected override pb::FieldAccess.FieldAccessorTable<TestXmlMessage, TestXmlMessage.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage__FieldAccessorTable; }
}
#region Nested types
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public static class Types {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Children : pb::GeneratedMessage<Children, Children.Builder> {
private static readonly Children defaultInstance = new Builder().BuildPartial();
public static Children DefaultInstance {
get { return defaultInstance; }
}
public override Children DefaultInstanceForType {
get { return defaultInstance; }
}
protected override Children ThisMessage {
get { return this; }
}
public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage_Children__Descriptor; }
}
protected override pb::FieldAccess.FieldAccessorTable<Children, Children.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlMessage_Children__FieldAccessorTable; }
}
public const int OptionsFieldNumber = 3;
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.EnumOptions> options_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.EnumOptions>();
public scg::IList<global::Google.ProtocolBuffers.TestProtos.EnumOptions> OptionsList {
get { return pbc::Lists.AsReadOnly(options_); }
}
public int OptionsCount {
get { return options_.Count; }
}
public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) {
return options_[index];
}
public const int BinaryFieldNumber = 4;
private bool hasBinary;
private pb::ByteString binary_ = pb::ByteString.Empty;
public bool HasBinary {
get { return hasBinary; }
}
public pb::ByteString Binary {
get { return binary_; }
}
public override bool IsInitialized {
get {
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
int size = SerializedSize;
if (options_.Count > 0) {
foreach (int element in options_) {
output.WriteEnum(3, element);
}
}
if (HasBinary) {
output.WriteBytes(4, Binary);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
if (options_.Count > 0) {
foreach (global::Google.ProtocolBuffers.TestProtos.EnumOptions element in options_) {
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element);
}
size += dataSize;
size += 1 * options_.Count;
}
}
if (HasBinary) {
size += pb::CodedOutputStream.ComputeBytesSize(4, Binary);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static Children ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static Children ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static Children ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static Children ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static Children ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static Children ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Children ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static Children ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static Children ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static Children ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Builder CreateBuilder() { return new Builder(); }
public override Builder ToBuilder() { return CreateBuilder(this); }
public override Builder CreateBuilderForType() { return new Builder(); }
public static Builder CreateBuilder(Children prototype) {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilder<Children, Builder> {
protected override Builder ThisBuilder {
get { return this; }
}
public Builder() {}
Children result = new Children();
protected override Children MessageBeingBuilt {
get { return result; }
}
public override Builder Clear() {
result = new Children();
return this;
}
public override Builder Clone() {
return new Builder().MergeFrom(result);
}
public override pbd::MessageDescriptor DescriptorForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Descriptor; }
}
public override Children DefaultInstanceForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance; }
}
public override Children BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.options_.MakeReadOnly();
Children returnMe = result;
result = null;
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is Children) {
return MergeFrom((Children) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(Children other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.DefaultInstance) return this;
if (other.options_.Count != 0) {
base.AddRange(other.options_, result.options_);
}
if (other.HasBinary) {
Binary = other.Binary;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
break;
}
case 24: {
int rawValue = input.ReadEnum();
if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.TestProtos.EnumOptions), rawValue)) {
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
unknownFields.MergeVarintField(3, (ulong) rawValue);
} else {
AddOptions((global::Google.ProtocolBuffers.TestProtos.EnumOptions) rawValue);
}
break;
}
case 34: {
Binary = input.ReadBytes();
break;
}
}
}
}
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.EnumOptions> OptionsList {
get { return result.options_; }
}
public int OptionsCount {
get { return result.OptionsCount; }
}
public global::Google.ProtocolBuffers.TestProtos.EnumOptions GetOptions(int index) {
return result.GetOptions(index);
}
public Builder SetOptions(int index, global::Google.ProtocolBuffers.TestProtos.EnumOptions value) {
result.options_[index] = value;
return this;
}
public Builder AddOptions(global::Google.ProtocolBuffers.TestProtos.EnumOptions value) {
result.options_.Add(value);
return this;
}
public Builder AddRangeOptions(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.EnumOptions> values) {
base.AddRange(values, result.options_);
return this;
}
public Builder ClearOptions() {
result.options_.Clear();
return this;
}
public bool HasBinary {
get { return result.HasBinary; }
}
public pb::ByteString Binary {
get { return result.Binary; }
set { SetBinary(value); }
}
public Builder SetBinary(pb::ByteString value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.hasBinary = true;
result.binary_ = value;
return this;
}
public Builder ClearBinary() {
result.hasBinary = false;
result.binary_ = pb::ByteString.Empty;
return this;
}
}
static Children() {
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null);
}
}
}
#endregion
public const int NumberFieldNumber = 6;
private bool hasNumber;
private long number_ = 0L;
public bool HasNumber {
get { return hasNumber; }
}
public long Number {
get { return number_; }
}
public const int NumbersFieldNumber = 2;
private pbc::PopsicleList<int> numbers_ = new pbc::PopsicleList<int>();
public scg::IList<int> NumbersList {
get { return pbc::Lists.AsReadOnly(numbers_); }
}
public int NumbersCount {
get { return numbers_.Count; }
}
public int GetNumbers(int index) {
return numbers_[index];
}
public const int TextFieldNumber = 3;
private bool hasText;
private string text_ = "";
public bool HasText {
get { return hasText; }
}
public string Text {
get { return text_; }
}
public const int TextlinesFieldNumber = 700;
private pbc::PopsicleList<string> textlines_ = new pbc::PopsicleList<string>();
public scg::IList<string> TextlinesList {
get { return pbc::Lists.AsReadOnly(textlines_); }
}
public int TextlinesCount {
get { return textlines_.Count; }
}
public string GetTextlines(int index) {
return textlines_[index];
}
public const int ValidFieldNumber = 5;
private bool hasValid;
private bool valid_ = false;
public bool HasValid {
get { return hasValid; }
}
public bool Valid {
get { return valid_; }
}
public const int ChildFieldNumber = 1;
private bool hasChild;
private global::Google.ProtocolBuffers.TestProtos.TestXmlChild child_ = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance;
public bool HasChild {
get { return hasChild; }
}
public global::Google.ProtocolBuffers.TestProtos.TestXmlChild Child {
get { return child_; }
}
public const int ChildrenFieldNumber = 401;
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children> children_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children>();
public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children> ChildrenList {
get { return children_; }
}
public int ChildrenCount {
get { return children_.Count; }
}
public global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children GetChildren(int index) {
return children_[index];
}
public override bool IsInitialized {
get {
if (!ExtensionsAreInitialized) return false;
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
int size = SerializedSize;
pb::ExtendableMessage<TestXmlMessage, TestXmlMessage.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
if (HasChild) {
output.WriteMessage(1, Child);
}
if (numbers_.Count > 0) {
foreach (int element in numbers_) {
output.WriteInt32(2, element);
}
}
if (HasText) {
output.WriteString(3, Text);
}
if (HasValid) {
output.WriteBool(5, Valid);
}
if (HasNumber) {
output.WriteInt64(6, Number);
}
extensionWriter.WriteUntil(200, output);
foreach (global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children element in ChildrenList) {
output.WriteGroup(401, element);
}
if (textlines_.Count > 0) {
foreach (string element in textlines_) {
output.WriteString(700, element);
}
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasNumber) {
size += pb::CodedOutputStream.ComputeInt64Size(6, Number);
}
{
int dataSize = 0;
foreach (int element in NumbersList) {
dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element);
}
size += dataSize;
size += 1 * numbers_.Count;
}
if (HasText) {
size += pb::CodedOutputStream.ComputeStringSize(3, Text);
}
{
int dataSize = 0;
foreach (string element in TextlinesList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 2 * textlines_.Count;
}
if (HasValid) {
size += pb::CodedOutputStream.ComputeBoolSize(5, Valid);
}
if (HasChild) {
size += pb::CodedOutputStream.ComputeMessageSize(1, Child);
}
foreach (global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children element in ChildrenList) {
size += pb::CodedOutputStream.ComputeGroupSize(401, element);
}
size += ExtensionsSerializedSize;
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static TestXmlMessage ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlMessage ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlMessage ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestXmlMessage ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestXmlMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestXmlMessage ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Builder CreateBuilder() { return new Builder(); }
public override Builder ToBuilder() { return CreateBuilder(this); }
public override Builder CreateBuilderForType() { return new Builder(); }
public static Builder CreateBuilder(TestXmlMessage prototype) {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::ExtendableBuilder<TestXmlMessage, Builder> {
protected override Builder ThisBuilder {
get { return this; }
}
public Builder() {}
TestXmlMessage result = new TestXmlMessage();
protected override TestXmlMessage MessageBeingBuilt {
get { return result; }
}
public override Builder Clear() {
result = new TestXmlMessage();
return this;
}
public override Builder Clone() {
return new Builder().MergeFrom(result);
}
public override pbd::MessageDescriptor DescriptorForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Descriptor; }
}
public override TestXmlMessage DefaultInstanceForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.DefaultInstance; }
}
public override TestXmlMessage BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
result.numbers_.MakeReadOnly();
result.textlines_.MakeReadOnly();
result.children_.MakeReadOnly();
TestXmlMessage returnMe = result;
result = null;
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is TestXmlMessage) {
return MergeFrom((TestXmlMessage) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(TestXmlMessage other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.DefaultInstance) return this;
if (other.HasNumber) {
Number = other.Number;
}
if (other.numbers_.Count != 0) {
base.AddRange(other.numbers_, result.numbers_);
}
if (other.HasText) {
Text = other.Text;
}
if (other.textlines_.Count != 0) {
base.AddRange(other.textlines_, result.textlines_);
}
if (other.HasValid) {
Valid = other.Valid;
}
if (other.HasChild) {
MergeChild(other.Child);
}
if (other.children_.Count != 0) {
base.AddRange(other.children_, result.children_);
}
this.MergeExtensionFields(other);
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
break;
}
case 10: {
global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.CreateBuilder();
if (HasChild) {
subBuilder.MergeFrom(Child);
}
input.ReadMessage(subBuilder, extensionRegistry);
Child = subBuilder.BuildPartial();
break;
}
case 16: {
AddNumbers(input.ReadInt32());
break;
}
case 26: {
Text = input.ReadString();
break;
}
case 40: {
Valid = input.ReadBool();
break;
}
case 48: {
Number = input.ReadInt64();
break;
}
case 3211: {
global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.CreateBuilder();
input.ReadGroup(401, subBuilder, extensionRegistry);
AddChildren(subBuilder.BuildPartial());
break;
}
case 5602: {
AddTextlines(input.ReadString());
break;
}
}
}
}
public bool HasNumber {
get { return result.HasNumber; }
}
public long Number {
get { return result.Number; }
set { SetNumber(value); }
}
public Builder SetNumber(long value) {
result.hasNumber = true;
result.number_ = value;
return this;
}
public Builder ClearNumber() {
result.hasNumber = false;
result.number_ = 0L;
return this;
}
public pbc::IPopsicleList<int> NumbersList {
get { return result.numbers_; }
}
public int NumbersCount {
get { return result.NumbersCount; }
}
public int GetNumbers(int index) {
return result.GetNumbers(index);
}
public Builder SetNumbers(int index, int value) {
result.numbers_[index] = value;
return this;
}
public Builder AddNumbers(int value) {
result.numbers_.Add(value);
return this;
}
public Builder AddRangeNumbers(scg::IEnumerable<int> values) {
base.AddRange(values, result.numbers_);
return this;
}
public Builder ClearNumbers() {
result.numbers_.Clear();
return this;
}
public bool HasText {
get { return result.HasText; }
}
public string Text {
get { return result.Text; }
set { SetText(value); }
}
public Builder SetText(string value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.hasText = true;
result.text_ = value;
return this;
}
public Builder ClearText() {
result.hasText = false;
result.text_ = "";
return this;
}
public pbc::IPopsicleList<string> TextlinesList {
get { return result.textlines_; }
}
public int TextlinesCount {
get { return result.TextlinesCount; }
}
public string GetTextlines(int index) {
return result.GetTextlines(index);
}
public Builder SetTextlines(int index, string value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.textlines_[index] = value;
return this;
}
public Builder AddTextlines(string value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.textlines_.Add(value);
return this;
}
public Builder AddRangeTextlines(scg::IEnumerable<string> values) {
base.AddRange(values, result.textlines_);
return this;
}
public Builder ClearTextlines() {
result.textlines_.Clear();
return this;
}
public bool HasValid {
get { return result.HasValid; }
}
public bool Valid {
get { return result.Valid; }
set { SetValid(value); }
}
public Builder SetValid(bool value) {
result.hasValid = true;
result.valid_ = value;
return this;
}
public Builder ClearValid() {
result.hasValid = false;
result.valid_ = false;
return this;
}
public bool HasChild {
get { return result.HasChild; }
}
public global::Google.ProtocolBuffers.TestProtos.TestXmlChild Child {
get { return result.Child; }
set { SetChild(value); }
}
public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.hasChild = true;
result.child_ = value;
return this;
}
public Builder SetChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild.Builder builderForValue) {
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
result.hasChild = true;
result.child_ = builderForValue.Build();
return this;
}
public Builder MergeChild(global::Google.ProtocolBuffers.TestProtos.TestXmlChild value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
if (result.HasChild &&
result.child_ != global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance) {
result.child_ = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.CreateBuilder(result.child_).MergeFrom(value).BuildPartial();
} else {
result.child_ = value;
}
result.hasChild = true;
return this;
}
public Builder ClearChild() {
result.hasChild = false;
result.child_ = global::Google.ProtocolBuffers.TestProtos.TestXmlChild.DefaultInstance;
return this;
}
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children> ChildrenList {
get { return result.children_; }
}
public int ChildrenCount {
get { return result.ChildrenCount; }
}
public global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children GetChildren(int index) {
return result.GetChildren(index);
}
public Builder SetChildren(int index, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.children_[index] = value;
return this;
}
public Builder SetChildren(int index, global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder builderForValue) {
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
result.children_[index] = builderForValue.Build();
return this;
}
public Builder AddChildren(global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children value) {
pb::ThrowHelper.ThrowIfNull(value, "value");
result.children_.Add(value);
return this;
}
public Builder AddChildren(global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children.Builder builderForValue) {
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
result.children_.Add(builderForValue.Build());
return this;
}
public Builder AddRangeChildren(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestXmlMessage.Types.Children> values) {
base.AddRange(values, result.children_);
return this;
}
public Builder ClearChildren() {
result.children_.Clear();
return this;
}
}
static TestXmlMessage() {
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class TestXmlExtension : pb::GeneratedMessage<TestXmlExtension, TestXmlExtension.Builder> {
private static readonly TestXmlExtension defaultInstance = new Builder().BuildPartial();
public static TestXmlExtension DefaultInstance {
get { return defaultInstance; }
}
public override TestXmlExtension DefaultInstanceForType {
get { return defaultInstance; }
}
protected override TestXmlExtension ThisMessage {
get { return this; }
}
public static pbd::MessageDescriptor Descriptor {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlExtension__Descriptor; }
}
protected override pb::FieldAccess.FieldAccessorTable<TestXmlExtension, TestXmlExtension.Builder> InternalFieldAccessors {
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.internal__static_protobuf_unittest_extra_TestXmlExtension__FieldAccessorTable; }
}
public const int NumberFieldNumber = 1;
private bool hasNumber;
private int number_ = 0;
public bool HasNumber {
get { return hasNumber; }
}
public int Number {
get { return number_; }
}
public override bool IsInitialized {
get {
if (!hasNumber) return false;
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
int size = SerializedSize;
if (HasNumber) {
output.WriteInt32(1, Number);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasNumber) {
size += pb::CodedOutputStream.ComputeInt32Size(1, Number);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static TestXmlExtension ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlExtension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlExtension ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static TestXmlExtension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
}
public static TestXmlExtension ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlExtension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static TestXmlExtension ParseDelimitedFrom(global::System.IO.Stream input) {
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
}
public static TestXmlExtension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
}
public static TestXmlExtension ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static TestXmlExtension ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
}
public static Builder CreateBuilder() { return new Builder(); }
public override Builder ToBuilder() { return CreateBuilder(this); }
public override Builder CreateBuilderForType() { return new Builder(); }
public static Builder CreateBuilder(TestXmlExtension prototype) {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilder<TestXmlExtension, Builder> {
protected override Builder ThisBuilder {
get { return this; }
}
public Builder() {}
TestXmlExtension result = new TestXmlExtension();
protected override TestXmlExtension MessageBeingBuilt {
get { return result; }
}
public override Builder Clear() {
result = new TestXmlExtension();
return this;
}
public override Builder Clone() {
return new Builder().MergeFrom(result);
}
public override pbd::MessageDescriptor DescriptorForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.Descriptor; }
}
public override TestXmlExtension DefaultInstanceForType {
get { return global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.DefaultInstance; }
}
public override TestXmlExtension BuildPartial() {
if (result == null) {
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
}
TestXmlExtension returnMe = result;
result = null;
return returnMe;
}
public override Builder MergeFrom(pb::IMessage other) {
if (other is TestXmlExtension) {
return MergeFrom((TestXmlExtension) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override Builder MergeFrom(TestXmlExtension other) {
if (other == global::Google.ProtocolBuffers.TestProtos.TestXmlExtension.DefaultInstance) return this;
if (other.HasNumber) {
Number = other.Number;
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override Builder MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields = null;
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0: {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
default: {
if (pb::WireFormat.IsEndGroupTag(tag)) {
if (unknownFields != null) {
this.UnknownFields = unknownFields.Build();
}
return this;
}
if (unknownFields == null) {
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
}
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
break;
}
case 8: {
Number = input.ReadInt32();
break;
}
}
}
}
public bool HasNumber {
get { return result.HasNumber; }
}
public int Number {
get { return result.Number; }
set { SetNumber(value); }
}
public Builder SetNumber(int value) {
result.hasNumber = true;
result.number_ = value;
return this;
}
public Builder ClearNumber() {
result.hasNumber = false;
result.number_ = 0;
return this;
}
}
static TestXmlExtension() {
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestXmlSerializerTestProtoFile.Descriptor, null);
}
}
#endregion
}
......@@ -404,8 +404,8 @@ namespace Google.ProtocolBuffers
"1:2: Extension \"nosuchext\" not found in the ExtensionRegistry.",
"[nosuchext]: 123");
AssertParseError(
"1:20: Extension \"protobuf_unittest.optional_int32_extension\" does " +
"not extend message type \"protobuf_unittest.TestAllTypes\".",
"1:20: Extension \"protobuf_unittest.optional_int32_extension\" " +
"not found in the ExtensionRegistry.",
"[protobuf_unittest.optional_int32_extension]: 123");
AssertParseError(
"1:1: Message type \"protobuf_unittest.TestAllTypes\" has no field " +
......
......@@ -6,13 +6,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{1F896D5C
..\protos\tutorial\addressbook.proto = ..\protos\tutorial\addressbook.proto
..\protos\google\protobuf\csharp_options.proto = ..\protos\google\protobuf\csharp_options.proto
..\protos\google\protobuf\descriptor.proto = ..\protos\google\protobuf\descriptor.proto
..\ProtocolBuffers.build = ..\ProtocolBuffers.build
..\todo.txt = ..\todo.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8D3015A-EA39-4F03-AEEC-3FF1F2087A12}"
ProjectSection(SolutionItems) = preProject
..\..\..\DotNet\ProtoFiles\Test\Protos\SampleComplex.proto = ..\..\..\DotNet\ProtoFiles\Test\Protos\SampleComplex.proto
..\protos\google\test\google_size.proto = ..\protos\google\test\google_size.proto
..\protos\google\test\google_speed.proto = ..\protos\google\test\google_speed.proto
..\protos\google\protobuf\unittest.proto = ..\protos\google\protobuf\unittest.proto
..\protos\google\protobuf\unittest_csharp_options.proto = ..\protos\google\protobuf\unittest_csharp_options.proto
..\protos\google\protobuf\unittest_custom_options.proto = ..\protos\google\protobuf\unittest_custom_options.proto
......@@ -20,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8
..\protos\google\protobuf\unittest_empty.proto = ..\protos\google\protobuf\unittest_empty.proto
..\protos\google\protobuf\unittest_enormous_descriptor.proto = ..\protos\google\protobuf\unittest_enormous_descriptor.proto
..\protos\extest\unittest_extras_lite.proto = ..\protos\extest\unittest_extras_lite.proto
..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto
..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto
..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto
..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto
..\protos\google\protobuf\unittest_lite.proto = ..\protos\google\protobuf\unittest_lite.proto
......@@ -27,6 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8
..\protos\google\protobuf\unittest_mset.proto = ..\protos\google\protobuf\unittest_mset.proto
..\protos\google\protobuf\unittest_no_generic_services.proto = ..\protos\google\protobuf\unittest_no_generic_services.proto
..\protos\google\protobuf\unittest_optimize_for.proto = ..\protos\google\protobuf\unittest_optimize_for.proto
..\protos\extest\unittest_rpc_interop.proto = ..\protos\extest\unittest_rpc_interop.proto
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}"
......@@ -51,6 +53,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950-AD27-42D7-88F8-94355AEC8225}"
ProjectSection(SolutionItems) = preProject
..\build\Build.bat = ..\build\Build.bat
..\build\build.csproj = ..\build\build.csproj
..\build\build35.bat = ..\build\build35.bat
..\build\BuildAll.bat = ..\build\BuildAll.bat
..\build\BuildSilverlight2.bat = ..\build\BuildSilverlight2.bat
..\build\Common.targets = ..\build\Common.targets
..\build\GenerateCompletePackage.bat = ..\build\GenerateCompletePackage.bat
..\build\GenerateReleasePackage.bat = ..\build\GenerateReleasePackage.bat
..\build\PublishRelease.bat = ..\build\PublishRelease.bat
..\build\RunBenchmarks.bat = ..\build\RunBenchmarks.bat
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Silverlight2|Any CPU = Debug_Silverlight2|Any CPU
......@@ -68,59 +84,45 @@ Global
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.Build.0 = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.Build.0 = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.Build.0 = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug_Silverlight2|Any CPU
......@@ -132,19 +134,15 @@ Global
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
......
......@@ -91,7 +91,12 @@ namespace Google.ProtocolBuffers
public byte[] ToByteArray()
{
return (byte[]) bytes.Clone();
return (byte[])bytes.Clone();
}
public string ToBase64()
{
return Convert.ToBase64String(bytes);
}
/// <summary>
......
......@@ -75,7 +75,7 @@ namespace Google.ProtocolBuffers
object IGeneratedExtensionLite.ContainingType
{
get { return Descriptor; }
get { return Descriptor.ContainingType; }
}
IMessageLite IGeneratedExtensionLite.MessageDefaultInstance
......
......@@ -93,53 +93,27 @@ namespace Google.ProtocolBuffers
/// </remarks>
public sealed partial class ExtensionRegistry
{
#if !LITE
private static readonly ExtensionRegistry empty = new ExtensionRegistry(
new Dictionary<string, ExtensionInfo>(),
new Dictionary<ExtensionIntPair, IGeneratedExtensionLite>(),
true);
private readonly IDictionary<string, ExtensionInfo> extensionsByName;
private ExtensionRegistry(IDictionary<String, ExtensionInfo> extensionsByName,
IDictionary<ExtensionIntPair, IGeneratedExtensionLite> extensionsByNumber,
bool readOnly)
: this(extensionsByNumber, readOnly)
{
this.extensionsByName = extensionsByName;
}
/// <summary>
/// Construct a new, empty instance.
/// </summary>
public static ExtensionRegistry CreateInstance()
{
return new ExtensionRegistry(new Dictionary<string, ExtensionInfo>(),
new Dictionary<ExtensionIntPair, IGeneratedExtensionLite>(), false);
}
public ExtensionRegistry AsReadOnly()
{
return new ExtensionRegistry(extensionsByName, extensionsByNumber, true);
}
#endif
/// <summary>
/// Finds an extension by fully-qualified field name, in the
/// proto namespace, i.e. result.Descriptor.FullName will match
/// <paramref name="fullName"/> if a match is found. A null
/// reference is returned if the extension can't be found.
/// </summary>
[Obsolete("Please use the FindByName method instead.", true)]
public ExtensionInfo this[string fullName]
{
get
{
ExtensionInfo ret;
extensionsByName.TryGetValue(fullName, out ret);
return ret;
foreach (IGeneratedExtensionLite ext in extensionsByNumber.Values)
{
if (StringComparer.Ordinal.Equals(ext.Descriptor.FullName, fullName))
return ext as ExtensionInfo;
}
return null;
}
}
#if !LITE
/// <summary>
/// Finds an extension by containing type and field number.
/// A null reference is returned if the extension can't be found.
......@@ -154,6 +128,12 @@ namespace Google.ProtocolBuffers
}
}
public ExtensionInfo FindByName(MessageDescriptor containingType, string fieldName)
{
return FindExtensionByName(containingType, fieldName) as ExtensionInfo;
}
#endif
/// <summary>
/// Add an extension from a generated file to the registry.
/// </summary>
......@@ -210,9 +190,8 @@ namespace Google.ProtocolBuffers
+ "regular (non-extension) field.");
}
extensionsByName[extension.Descriptor.FullName] = extension;
extensionsByNumber[new ExtensionIntPair(extension.Descriptor.ContainingType,
extension.Descriptor.FieldNumber)] = extension;
IGeneratedExtensionLite liteExtension = extension;
Add(liteExtension);
FieldDescriptor field = extension.Descriptor;
if (field.ContainingType.Options.MessageSetWireFormat
......@@ -223,7 +202,9 @@ namespace Google.ProtocolBuffers
// This is an extension of a MessageSet type defined within the extension
// type's own scope. For backwards-compatibility, allow it to be looked
// up by type name.
extensionsByName[field.MessageType.FullName] = extension;
Dictionary<string, IGeneratedExtensionLite> map;
if (extensionsByName.TryGetValue(liteExtension.ContainingType, out map))
map[field.MessageType.FullName] = extension;
}
}
}
......
......@@ -36,6 +36,7 @@
using System.Collections.Generic;
using System;
using Google.ProtocolBuffers.Descriptors;
namespace Google.ProtocolBuffers
{
......@@ -92,37 +93,39 @@ namespace Google.ProtocolBuffers
/// </remarks>
public sealed partial class ExtensionRegistry
{
private readonly IDictionary<ExtensionIntPair, IGeneratedExtensionLite> extensionsByNumber;
class ExtensionByNameMap : Dictionary<object, Dictionary<string, IGeneratedExtensionLite>> { }
class ExtensionByIdMap : Dictionary<ExtensionIntPair, IGeneratedExtensionLite> { }
private static readonly ExtensionRegistry empty = new ExtensionRegistry(
new ExtensionByNameMap(),
new ExtensionByIdMap(),
true);
private readonly ExtensionByNameMap extensionsByName;
private readonly ExtensionByIdMap extensionsByNumber;
private readonly bool readOnly;
private ExtensionRegistry(IDictionary<ExtensionIntPair, IGeneratedExtensionLite> extensionsByNumber,
bool readOnly)
private ExtensionRegistry(ExtensionByNameMap byName, ExtensionByIdMap byNumber, bool readOnly)
{
this.extensionsByNumber = extensionsByNumber;
this.extensionsByName = byName;
this.extensionsByNumber = byNumber;
this.readOnly = readOnly;
}
#if LITE
private static readonly ExtensionRegistry empty = new ExtensionRegistry(
new Dictionary<ExtensionIntPair, IGeneratedExtensionLite>(),
true);
/// <summary>
/// Construct a new, empty instance.
/// </summary>
public static ExtensionRegistry CreateInstance()
{
return new ExtensionRegistry(
new Dictionary<ExtensionIntPair, IGeneratedExtensionLite>(), false);
return new ExtensionRegistry(new ExtensionByNameMap(), new ExtensionByIdMap(), false);
}
public ExtensionRegistry AsReadOnly()
{
return new ExtensionRegistry(extensionsByNumber, true);
return new ExtensionRegistry(extensionsByName, extensionsByNumber, true);
}
#endif
/// <summary>
/// Get the unmodifiable singleton empty instance.
/// </summary>
......@@ -145,6 +148,18 @@ namespace Google.ProtocolBuffers
}
}
public IGeneratedExtensionLite FindByName(IMessageLite defaultInstanceOfType, string fieldName)
{ return FindExtensionByName(defaultInstanceOfType, fieldName); }
IGeneratedExtensionLite FindExtensionByName(object forwhat, string fieldName)
{
IGeneratedExtensionLite extension = null;
Dictionary<string, IGeneratedExtensionLite> map;
if (extensionsByName.TryGetValue(forwhat, out map) && map.TryGetValue(fieldName, out extension))
return extension;
return null;
}
/// <summary>
/// Add an extension from a generated file to the registry.
/// </summary>
......@@ -154,9 +169,13 @@ namespace Google.ProtocolBuffers
{
throw new InvalidOperationException("Cannot add entries to a read-only extension registry");
}
extensionsByNumber.Add(
new ExtensionIntPair(extension.ContainingType, extension.Number),
extension);
extensionsByNumber.Add(new ExtensionIntPair(extension.ContainingType, extension.Number), extension);
Dictionary<string, IGeneratedExtensionLite> map;
if (!extensionsByName.TryGetValue(extension.ContainingType, out map))
extensionsByName.Add(extension.ContainingType, map = new Dictionary<string, IGeneratedExtensionLite>());
map[extension.Descriptor.Name] = extension;
map[extension.Descriptor.FullName] = extension;
}
/// <summary>
......@@ -176,7 +195,7 @@ namespace Google.ProtocolBuffers
public override int GetHashCode()
{
return msgType.GetHashCode()*((1 << 16) - 1) + number;
return msgType.GetHashCode() * ((1 << 16) - 1) + number;
}
public override bool Equals(object obj)
......@@ -185,7 +204,7 @@ namespace Google.ProtocolBuffers
{
return false;
}
return Equals((ExtensionIntPair) obj);
return Equals((ExtensionIntPair)obj);
}
public bool Equals(ExtensionIntPair other)
......
......@@ -50,6 +50,7 @@ namespace Google.ProtocolBuffers
bool IsExtension { get; }
bool MessageSetWireFormat { get; } //field.ContainingType.Options.MessageSetWireFormat
int FieldNumber { get; }
string Name { get; }
string FullName { get; }
IEnumLiteMap EnumType { get; }
FieldType FieldType { get; }
......
......@@ -74,6 +74,18 @@ namespace Google.ProtocolBuffers
this.defaultValue = defaultValue;
}
public string Name
{
get
{
string name = fullName;
int offset = name.LastIndexOf('.');
if (offset >= 0)
name = name.Substring(offset);
return name;
}
}
public string FullName
{
get { return fullName; }
......
......@@ -166,14 +166,22 @@ namespace Google.ProtocolBuffers
{
switch (field.FieldType)
{
// The Float and Double types must specify the "r" format to preserve their precision, otherwise,
// the double to/from string will trim the precision to 6 places. As with other numeric formats
// below, always use the invariant culture so it's predictable.
case FieldType.Float:
generator.Print(((float)value).ToString("r", CultureInfo.InvariantCulture));
break;
case FieldType.Double:
generator.Print(((double)value).ToString("r", CultureInfo.InvariantCulture));
break;
case FieldType.Int32:
case FieldType.Int64:
case FieldType.SInt32:
case FieldType.SInt64:
case FieldType.SFixed32:
case FieldType.SFixed64:
case FieldType.Float:
case FieldType.Double:
case FieldType.UInt32:
case FieldType.UInt64:
case FieldType.Fixed32:
......@@ -670,7 +678,7 @@ namespace Google.ProtocolBuffers
name.Append(tokenizer.ConsumeIdentifier());
}
extension = extensionRegistry[name.ToString()];
extension = extensionRegistry.FindByName(type, name.ToString());
if (extension == null)
{
......
......@@ -35,12 +35,8 @@
#endregion
using System;
#if !LITE
using Google.ProtocolBuffers.Descriptors;
#endif
namespace Google.ProtocolBuffers
{
/// <summary>
......@@ -146,6 +142,7 @@ namespace Google.ProtocolBuffers
return descriptor.IsPacked ? WireType.LengthDelimited : GetWireType(descriptor.FieldType);
}
#endif
/// <summary>
/// Converts a field type to its wire type. Done with a switch for the sake
/// of speed - this is significantly faster than a dictionary lookup.
......@@ -190,6 +187,5 @@ namespace Google.ProtocolBuffers
throw new ArgumentOutOfRangeException("No such field type");
}
}
#endif
}
}
\ No newline at end of file
......@@ -10,14 +10,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{1F896D5C
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unittest", "unittest", "{C8D3015A-EA39-4F03-AEEC-3FF1F2087A12}"
ProjectSection(SolutionItems) = preProject
..\protos\google\test\google_size.proto = ..\protos\google\test\google_size.proto
..\protos\google\test\google_speed.proto = ..\protos\google\test\google_speed.proto
..\protos\google\protobuf\unittest.proto = ..\protos\google\protobuf\unittest.proto
..\protos\google\protobuf\unittest_csharp_options.proto = ..\protos\google\protobuf\unittest_csharp_options.proto
..\protos\google\protobuf\unittest_custom_options.proto = ..\protos\google\protobuf\unittest_custom_options.proto
..\protos\google\protobuf\unittest_embed_optimize_for.proto = ..\protos\google\protobuf\unittest_embed_optimize_for.proto
..\protos\google\protobuf\unittest_empty.proto = ..\protos\google\protobuf\unittest_empty.proto
..\protos\google\protobuf\unittest_enormous_descriptor.proto = ..\protos\google\protobuf\unittest_enormous_descriptor.proto
..\protos\extest\unittest_extras_full.proto = ..\protos\extest\unittest_extras_full.proto
..\protos\extest\unittest_extras_lite.proto = ..\protos\extest\unittest_extras_lite.proto
..\protos\extest\unittest_extras_xmltest.proto = ..\protos\extest\unittest_extras_xmltest.proto
..\protos\extest\unittest_generic_services.proto = ..\protos\extest\unittest_generic_services.proto
..\protos\google\protobuf\unittest_import.proto = ..\protos\google\protobuf\unittest_import.proto
..\protos\google\protobuf\unittest_import_lite.proto = ..\protos\google\protobuf\unittest_import_lite.proto
......@@ -82,59 +84,45 @@ Global
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{250ADE34-82FD-4BAE-86D5-985FBE589C4A}.Release|Any CPU.Build.0 = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C268DA4C-4004-47DA-AF23-44C983281A68}.Release|Any CPU.Build.0 = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A31F5FB2-4FF3-432A-B35B-5CD203606311}.Release|Any CPU.Build.0 = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F09AF72-3327-4FA7-BC09-070B80221AB9}.Release|Any CPU.Build.0 = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7A4A435-2813-41C8-AA87-BD914BA5223D}.Release|Any CPU.Build.0 = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7282E99-2DC3-405B-946F-177DB2FD2AE2}.Release|Any CPU.Build.0 = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug_Silverlight2|Any CPU
......@@ -146,19 +134,15 @@ Global
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug_Silverlight2|Any CPU.Build.0 = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.Build.0 = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
......
// Generated by ProtoGen, Version=0.9.0.0, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT!
// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT!
using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
......@@ -6,6 +6,9 @@ using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
namespace Google.ProtocolBuffers.TestProtos {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public static partial class UnitTestExtrasLiteProtoFile {
#region Extension registration
......@@ -38,6 +41,8 @@ namespace Google.ProtocolBuffers.TestProtos {
}
#region Enums
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public enum ExtraEnum {
DEFAULT = 10,
EXLITE_FOO = 7,
......@@ -48,6 +53,9 @@ namespace Google.ProtocolBuffers.TestProtos {
#endregion
#region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class TestRequiredLite : pb::GeneratedMessageLite<TestRequiredLite, TestRequiredLite.Builder> {
private static readonly TestRequiredLite defaultInstance = new Builder().BuildPartial();
public static TestRequiredLite DefaultInstance {
......@@ -177,6 +185,9 @@ namespace Google.ProtocolBuffers.TestProtos {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilderLite<TestRequiredLite, Builder> {
protected override Builder ThisBuilder {
get { return this; }
......@@ -307,6 +318,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class TestInteropPersonLite : pb::ExtendableMessageLite<TestInteropPersonLite, TestInteropPersonLite.Builder> {
private static readonly TestInteropPersonLite defaultInstance = new Builder().BuildPartial();
public static TestInteropPersonLite DefaultInstance {
......@@ -322,13 +336,21 @@ namespace Google.ProtocolBuffers.TestProtos {
}
#region Nested types
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public static class Types {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public enum PhoneType {
MOBILE = 0,
HOME = 1,
WORK = 2,
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class PhoneNumber : pb::GeneratedMessageLite<PhoneNumber, PhoneNumber.Builder> {
private static readonly PhoneNumber defaultInstance = new Builder().BuildPartial();
public static PhoneNumber DefaultInstance {
......@@ -457,6 +479,9 @@ namespace Google.ProtocolBuffers.TestProtos {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilderLite<PhoneNumber, Builder> {
protected override Builder ThisBuilder {
get { return this; }
......@@ -588,6 +613,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Addresses : pb::GeneratedMessageLite<Addresses, Addresses.Builder> {
private static readonly Addresses defaultInstance = new Builder().BuildPartial();
public static Addresses DefaultInstance {
......@@ -777,6 +805,9 @@ namespace Google.ProtocolBuffers.TestProtos {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilderLite<Addresses, Builder> {
protected override Builder ThisBuilder {
get { return this; }
......@@ -1216,6 +1247,9 @@ namespace Google.ProtocolBuffers.TestProtos {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::ExtendableBuilderLite<TestInteropPersonLite, Builder> {
protected override Builder ThisBuilder {
get { return this; }
......@@ -1505,6 +1539,9 @@ namespace Google.ProtocolBuffers.TestProtos {
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class TestInteropEmployeeIdLite : pb::GeneratedMessageLite<TestInteropEmployeeIdLite, TestInteropEmployeeIdLite.Builder> {
private static readonly TestInteropEmployeeIdLite defaultInstance = new Builder().BuildPartial();
public static TestInteropEmployeeIdLite DefaultInstance {
......@@ -1614,6 +1651,9 @@ namespace Google.ProtocolBuffers.TestProtos {
return (Builder) new Builder().MergeFrom(prototype);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
public sealed partial class Builder : pb::GeneratedBuilderLite<TestInteropEmployeeIdLite, Builder> {
protected override Builder ThisBuilder {
get { return this; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment