Merge pull request #313 from jskeet/csharp
First steps to making the C# runtime work with new codegenpull/319/head
commit
32ead755d1
78 changed files with 183367 additions and 104432 deletions
@ -1,37 +0,0 @@ |
||||
// 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 = "UnitTestExtrasProtoFile"; |
||||
option (google.protobuf.csharp_file_options).add_serializable = true; |
||||
|
||||
package protobuf_unittest_extra; |
||||
|
||||
option java_package = "com.google.protobuf"; |
||||
|
||||
message TestUnpackedExtensions { |
||||
extensions 1 to max; |
||||
} |
||||
|
||||
extend TestUnpackedExtensions { |
||||
repeated int32 unpacked_int32_extension = 90; |
||||
repeated int64 unpacked_int64_extension = 91; |
||||
repeated uint32 unpacked_uint32_extension = 92; |
||||
repeated uint64 unpacked_uint64_extension = 93; |
||||
repeated sint32 unpacked_sint32_extension = 94; |
||||
repeated sint64 unpacked_sint64_extension = 95; |
||||
repeated fixed32 unpacked_fixed32_extension = 96; |
||||
repeated fixed64 unpacked_fixed64_extension = 97; |
||||
repeated sfixed32 unpacked_sfixed32_extension = 98; |
||||
repeated sfixed64 unpacked_sfixed64_extension = 99; |
||||
repeated float unpacked_float_extension = 100; |
||||
repeated double unpacked_double_extension = 101; |
||||
repeated bool unpacked_bool_extension = 102; |
||||
repeated UnpackedExtensionsForeignEnum unpacked_enum_extension = 103; |
||||
} |
||||
|
||||
enum UnpackedExtensionsForeignEnum { |
||||
FOREIGN_FOO = 4; |
||||
FOREIGN_BAR = 5; |
||||
FOREIGN_BAZ = 6; |
||||
} |
@ -1,29 +1,30 @@ |
||||
syntax = "proto2"; |
||||
|
||||
// Additional options required for C# generation. File from copyright |
||||
// line onwards is as per original distribution. |
||||
import "google/protobuf/csharp_options.proto"; |
||||
import "google/protobuf/unittest.proto"; |
||||
import "google/protobuf/unittest_custom_options.proto"; |
||||
option (google.protobuf.csharp_file_options).namespace = "Google.ProtocolBuffers.TestProtos"; |
||||
option (google.protobuf.csharp_file_options).umbrella_classname = "UnitTestGenericServices"; |
||||
|
||||
option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; |
||||
option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; |
||||
|
||||
// option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; |
||||
|
||||
// We don't put this in a package within proto2 because we need to make sure |
||||
// that the generated code doesn't depend on being in the proto2 namespace. |
||||
package protobuf_unittest; |
||||
|
||||
// We don't put this in a package within proto2 because we need to make sure |
||||
// that the generated code doesn't depend on being in the proto2 namespace. |
||||
package protobuf_unittest; |
||||
|
||||
option optimize_for = SPEED; |
||||
|
||||
service TestGenericService { |
||||
rpc Foo(FooRequest) returns (FooResponse); |
||||
rpc Bar(BarRequest) returns (BarResponse); |
||||
} |
||||
|
||||
service TestGenericServiceWithCustomOptions { |
||||
option (service_opt1) = -9876543210; |
||||
|
||||
rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { |
||||
option (method_opt1) = METHODOPT1_VAL2; |
||||
} |
||||
} |
||||
|
||||
|
||||
service TestGenericServiceWithCustomOptions { |
||||
option (service_opt1) = -9876543210; |
||||
|
||||
rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { |
||||
option (method_opt1) = METHODOPT1_VAL2; |
||||
} |
||||
} |
||||
|
||||
|
@ -1,127 +0,0 @@ |
||||
#region Copyright notice and license |
||||
|
||||
// Protocol Buffers - Google's data interchange format |
||||
// Copyright 2008 Google Inc. All rights reserved. |
||||
// http://github.com/jskeet/dotnet-protobufs/ |
||||
// Original C++/Java/Python code: |
||||
// http://code.google.com/p/protobuf/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
#endregion |
||||
|
||||
using Google.ProtocolBuffers.DescriptorProtos; |
||||
using Google.ProtocolBuffers.Descriptors; |
||||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
||||
|
||||
namespace Google.ProtocolBuffers |
||||
{ |
||||
[TestClass] |
||||
public class DescriptorUtilTest |
||||
{ |
||||
[TestMethod] |
||||
public void ExplicitNamespace() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder |
||||
{ |
||||
Name = "x", |
||||
Package = "pack", |
||||
Options = |
||||
new FileOptions.Builder().SetExtension( |
||||
CSharpOptions.CSharpFileOptions, |
||||
new CSharpFileOptions.Builder {Namespace = "Foo.Bar"}.Build()). |
||||
Build() |
||||
}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("Foo.Bar", descriptor.CSharpOptions.Namespace); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void NoNamespaceFallsBackToPackage() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x", Package = "pack"}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("pack", descriptor.CSharpOptions.Namespace); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void NoNamespaceOrPackageFallsBackToEmptyString() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x"}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("", descriptor.CSharpOptions.Namespace); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void ExplicitlyNamedFileClass() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder |
||||
{ |
||||
Name = "x", |
||||
Options = |
||||
new FileOptions.Builder().SetExtension( |
||||
CSharpOptions.CSharpFileOptions, |
||||
new CSharpFileOptions.Builder {UmbrellaClassname = "Foo"}.Build()) |
||||
.Build() |
||||
}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("Foo", descriptor.CSharpOptions.UmbrellaClassname); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void ImplicitFileClassWithProtoSuffix() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.proto"}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void ImplicitFileClassWithProtoDevelSuffix() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar.protodevel"}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void ImplicitFileClassWithNoSuffix() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "foo_bar"}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void ImplicitFileClassWithDirectoryStructure() |
||||
{ |
||||
FileDescriptorProto proto = new FileDescriptorProto.Builder {Name = "x/y/foo_bar"}.Build(); |
||||
FileDescriptor descriptor = FileDescriptor.BuildFrom(proto, null); |
||||
Assert.AreEqual("FooBar", descriptor.CSharpOptions.UmbrellaClassname); |
||||
} |
||||
} |
||||
} |
@ -1,72 +0,0 @@ |
||||
#region Copyright notice and license |
||||
|
||||
// Protocol Buffers - Google's data interchange format |
||||
// Copyright 2008 Google Inc. All rights reserved. |
||||
// http://github.com/jskeet/dotnet-protobufs/ |
||||
// Original C++/Java/Python code: |
||||
// http://code.google.com/p/protobuf/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
#endregion |
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
||||
using Google.ProtocolBuffers.TestProtos; |
||||
|
||||
namespace Google.ProtocolBuffers.Descriptors |
||||
{ |
||||
[TestClass] |
||||
public class MessageDescriptorTest |
||||
{ |
||||
[TestMethod] |
||||
public void FindPropertyWithDefaultName() |
||||
{ |
||||
Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.NormalFieldNumber), |
||||
OptionsMessage.Descriptor.FindFieldByPropertyName("Normal")); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void FindPropertyWithAutoModifiedName() |
||||
{ |
||||
Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.OptionsMessage_FieldNumber), |
||||
OptionsMessage.Descriptor.FindFieldByPropertyName("OptionsMessage_")); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void FindPropertyWithCustomizedName() |
||||
{ |
||||
Assert.AreSame(OptionsMessage.Descriptor.FindFieldByNumber(OptionsMessage.CustomNameFieldNumber), |
||||
OptionsMessage.Descriptor.FindFieldByPropertyName("CustomName")); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void FindPropertyWithInvalidName() |
||||
{ |
||||
Assert.IsNull(OptionsMessage.Descriptor.FindFieldByPropertyName("Bogus")); |
||||
} |
||||
} |
||||
} |
@ -1,262 +0,0 @@ |
||||
#region Copyright notice and license |
||||
|
||||
// Protocol Buffers - Google's data interchange format |
||||
// Copyright 2008 Google Inc. All rights reserved. |
||||
// http://github.com/jskeet/dotnet-protobufs/ |
||||
// Original C++/Java/Python code: |
||||
// http://code.google.com/p/protobuf/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
#endregion |
||||
|
||||
using System; |
||||
using Google.ProtocolBuffers.Descriptors; |
||||
using Google.ProtocolBuffers.TestProtos; |
||||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
||||
|
||||
namespace Google.ProtocolBuffers |
||||
{ |
||||
/// <summary> |
||||
/// Tests for generated service classes. |
||||
/// TODO(jonskeet): Convert the mocking tests using Rhino.Mocks. |
||||
/// </summary> |
||||
[TestClass] |
||||
public class ServiceTest |
||||
{ |
||||
private delegate void Action<T1, T2>(T1 t1, T2 t2); |
||||
|
||||
private static readonly MethodDescriptor FooDescriptor = TestGenericService.Descriptor.Methods[0]; |
||||
private static readonly MethodDescriptor BarDescriptor = TestGenericService.Descriptor.Methods[1]; |
||||
|
||||
[TestMethod] |
||||
public void GetRequestPrototype() |
||||
{ |
||||
TestGenericService service = new TestServiceImpl(); |
||||
|
||||
Assert.AreSame(service.GetRequestPrototype(FooDescriptor), FooRequest.DefaultInstance); |
||||
Assert.AreSame(service.GetRequestPrototype(BarDescriptor), BarRequest.DefaultInstance); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void GetResponsePrototype() |
||||
{ |
||||
TestGenericService service = new TestServiceImpl(); |
||||
|
||||
Assert.AreSame(service.GetResponsePrototype(FooDescriptor), FooResponse.DefaultInstance); |
||||
Assert.AreSame(service.GetResponsePrototype(BarDescriptor), BarResponse.DefaultInstance); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void CallMethodFoo() |
||||
{ |
||||
FooRequest fooRequest = FooRequest.CreateBuilder().Build(); |
||||
FooResponse fooResponse = FooResponse.CreateBuilder().Build(); |
||||
IRpcController controller = new RpcTestController(); |
||||
|
||||
bool fooCalled = false; |
||||
|
||||
TestGenericService service = new TestServiceImpl((request, responseAction) => |
||||
{ |
||||
Assert.AreSame(fooRequest, request); |
||||
fooCalled = true; |
||||
responseAction(fooResponse); |
||||
}, null, controller); |
||||
|
||||
bool doneHandlerCalled = false; |
||||
Action<IMessage> doneHandler = (response => |
||||
{ |
||||
Assert.AreSame(fooResponse, response); |
||||
doneHandlerCalled = true; |
||||
}); |
||||
|
||||
service.CallMethod(FooDescriptor, controller, fooRequest, doneHandler); |
||||
|
||||
Assert.IsTrue(doneHandlerCalled); |
||||
Assert.IsTrue(fooCalled); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void CallMethodBar() |
||||
{ |
||||
BarRequest barRequest = BarRequest.CreateBuilder().Build(); |
||||
BarResponse barResponse = BarResponse.CreateBuilder().Build(); |
||||
IRpcController controller = new RpcTestController(); |
||||
|
||||
bool barCalled = false; |
||||
|
||||
TestGenericService service = new TestServiceImpl(null, (request, responseAction) => |
||||
{ |
||||
Assert.AreSame(barRequest, request); |
||||
barCalled = true; |
||||
responseAction(barResponse); |
||||
}, controller); |
||||
|
||||
bool doneHandlerCalled = false; |
||||
Action<IMessage> doneHandler = (response => |
||||
{ |
||||
Assert.AreSame(barResponse, response); |
||||
doneHandlerCalled = true; |
||||
}); |
||||
|
||||
service.CallMethod(BarDescriptor, controller, barRequest, doneHandler); |
||||
|
||||
Assert.IsTrue(doneHandlerCalled); |
||||
Assert.IsTrue(barCalled); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void GeneratedStubFooCall() |
||||
{ |
||||
IRpcChannel channel = new RpcTestChannel(); |
||||
IRpcController controller = new RpcTestController(); |
||||
TestGenericService service = TestGenericService.CreateStub(channel); |
||||
FooResponse fooResponse = null; |
||||
Action<FooResponse> doneHandler = r => fooResponse = r; |
||||
|
||||
service.Foo(controller, FooRequest.DefaultInstance, doneHandler); |
||||
|
||||
Assert.IsNotNull(fooResponse); |
||||
Assert.IsFalse(controller.Failed); |
||||
} |
||||
|
||||
[TestMethod] |
||||
public void GeneratedStubBarCallFails() |
||||
{ |
||||
IRpcChannel channel = new RpcTestChannel(); |
||||
IRpcController controller = new RpcTestController(); |
||||
TestGenericService service = TestGenericService.CreateStub(channel); |
||||
BarResponse barResponse = null; |
||||
Action<BarResponse> doneHandler = r => barResponse = r; |
||||
|
||||
service.Bar(controller, BarRequest.DefaultInstance, doneHandler); |
||||
|
||||
Assert.IsNull(barResponse); |
||||
Assert.IsTrue(controller.Failed); |
||||
} |
||||
|
||||
#region RpcTestController |
||||
private class RpcTestController : IRpcController |
||||
{ |
||||
public string TestFailedReason { get; set; } |
||||
public bool TestCancelled { get; set; } |
||||
public Action<object> TestCancelledCallback { get; set; } |
||||
|
||||
void IRpcController.Reset() |
||||
{ |
||||
TestFailedReason = null; |
||||
TestCancelled = false; |
||||
TestCancelledCallback = null; |
||||
} |
||||
|
||||
bool IRpcController.Failed |
||||
{ |
||||
get { return TestFailedReason != null; } |
||||
} |
||||
|
||||
string IRpcController.ErrorText |
||||
{ |
||||
get { return TestFailedReason; } |
||||
} |
||||
|
||||
void IRpcController.StartCancel() |
||||
{ |
||||
TestCancelled = true; |
||||
if (TestCancelledCallback != null) |
||||
TestCancelledCallback(this); |
||||
} |
||||
|
||||
void IRpcController.SetFailed(string reason) |
||||
{ |
||||
TestFailedReason = reason; |
||||
} |
||||
|
||||
bool IRpcController.IsCanceled() |
||||
{ |
||||
return TestCancelled; |
||||
} |
||||
|
||||
void IRpcController.NotifyOnCancel(Action<object> callback) |
||||
{ |
||||
TestCancelledCallback = callback; |
||||
} |
||||
} |
||||
#endregion |
||||
#region RpcTestChannel |
||||
private class RpcTestChannel : IRpcChannel |
||||
{ |
||||
public MethodDescriptor TestMethodCalled { get; set; } |
||||
|
||||
void IRpcChannel.CallMethod(MethodDescriptor method, IRpcController controller, IMessage request, IMessage responsePrototype, Action<IMessage> done) |
||||
{ |
||||
TestMethodCalled = method; |
||||
try |
||||
{ |
||||
done(FooResponse.DefaultInstance); |
||||
} |
||||
catch (Exception e) |
||||
{ |
||||
controller.SetFailed(e.Message); |
||||
} |
||||
} |
||||
} |
||||
#endregion |
||||
#region TestServiceImpl |
||||
private class TestServiceImpl : TestGenericService |
||||
{ |
||||
private readonly Action<FooRequest, Action<FooResponse>> fooHandler; |
||||
private readonly Action<BarRequest, Action<BarResponse>> barHandler; |
||||
private readonly IRpcController expectedController; |
||||
|
||||
internal TestServiceImpl() |
||||
{ |
||||
} |
||||
|
||||
internal TestServiceImpl(Action<FooRequest, Action<FooResponse>> fooHandler, |
||||
Action<BarRequest, Action<BarResponse>> barHandler, |
||||
IRpcController expectedController) |
||||
{ |
||||
this.fooHandler = fooHandler; |
||||
this.barHandler = barHandler; |
||||
this.expectedController = expectedController; |
||||
} |
||||
|
||||
public override void Foo(IRpcController controller, FooRequest request, Action<FooResponse> done) |
||||
{ |
||||
Assert.AreSame(expectedController, controller); |
||||
fooHandler(request, done); |
||||
} |
||||
|
||||
public override void Bar(IRpcController controller, BarRequest request, Action<BarResponse> done) |
||||
{ |
||||
Assert.AreSame(expectedController, controller); |
||||
barHandler(request, done); |
||||
} |
||||
} |
||||
#endregion |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,426 +0,0 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestCSharpOptionsProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OptionsMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.OptionsMessage, global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Builder> internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestCSharpOptionsProtoFile() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"Ci1nb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfY3NoYXJwX29wdGlvbnMucHJv", |
||||
"dG8SEXByb3RvYnVmX3VuaXR0ZXN0GiRnb29nbGUvcHJvdG9idWYvY3NoYXJw", |
||||
"X29wdGlvbnMucHJvdG8iXgoOT3B0aW9uc01lc3NhZ2USDgoGbm9ybWFsGAEg", |
||||
"ASgJEhcKD29wdGlvbnNfbWVzc2FnZRgCIAEoCRIjCgpjdXN0b21pemVkGAMg", |
||||
"ASgJQg/CPgwKCkN1c3RvbU5hbWVCRsI+QwohR29vZ2xlLlByb3RvY29sQnVm", |
||||
"ZmVycy5UZXN0UHJvdG9zEh5Vbml0VGVzdENTaGFycE9wdGlvbnNQcm90b0Zp", |
||||
"bGU=")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_OptionsMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.OptionsMessage, global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Builder>(internal__static_protobuf_unittest_OptionsMessage__Descriptor, |
||||
new string[] { "Normal", "OptionsMessage_", "CustomName", }); |
||||
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 Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class OptionsMessage : pb::GeneratedMessage<OptionsMessage, OptionsMessage.Builder> { |
||||
private OptionsMessage() { } |
||||
private static readonly OptionsMessage defaultInstance = new OptionsMessage().MakeReadOnly(); |
||||
private static readonly string[] _optionsMessageFieldNames = new string[] { "customized", "normal", "options_message" }; |
||||
private static readonly uint[] _optionsMessageFieldTags = new uint[] { 26, 10, 18 }; |
||||
public static OptionsMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override OptionsMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override OptionsMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<OptionsMessage, OptionsMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.internal__static_protobuf_unittest_OptionsMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int NormalFieldNumber = 1; |
||||
private bool hasNormal; |
||||
private string normal_ = ""; |
||||
public bool HasNormal { |
||||
get { return hasNormal; } |
||||
} |
||||
public string Normal { |
||||
get { return normal_; } |
||||
} |
||||
|
||||
public const int OptionsMessage_FieldNumber = 2; |
||||
private bool hasOptionsMessage_; |
||||
private string optionsMessage_ = ""; |
||||
public bool HasOptionsMessage_ { |
||||
get { return hasOptionsMessage_; } |
||||
} |
||||
public string OptionsMessage_ { |
||||
get { return optionsMessage_; } |
||||
} |
||||
|
||||
public const int CustomNameFieldNumber = 3; |
||||
private bool hasCustomName; |
||||
private string customized_ = ""; |
||||
public bool HasCustomName { |
||||
get { return hasCustomName; } |
||||
} |
||||
public string CustomName { |
||||
get { return customized_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _optionsMessageFieldNames; |
||||
if (hasNormal) { |
||||
output.WriteString(1, field_names[1], Normal); |
||||
} |
||||
if (hasOptionsMessage_) { |
||||
output.WriteString(2, field_names[2], OptionsMessage_); |
||||
} |
||||
if (hasCustomName) { |
||||
output.WriteString(3, field_names[0], CustomName); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasNormal) { |
||||
size += pb::CodedOutputStream.ComputeStringSize(1, Normal); |
||||
} |
||||
if (hasOptionsMessage_) { |
||||
size += pb::CodedOutputStream.ComputeStringSize(2, OptionsMessage_); |
||||
} |
||||
if (hasCustomName) { |
||||
size += pb::CodedOutputStream.ComputeStringSize(3, CustomName); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static OptionsMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static OptionsMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private OptionsMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(OptionsMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<OptionsMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(OptionsMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private OptionsMessage result; |
||||
|
||||
private OptionsMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
OptionsMessage original = result; |
||||
result = new OptionsMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override OptionsMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.Descriptor; } |
||||
} |
||||
|
||||
public override OptionsMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override OptionsMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is OptionsMessage) { |
||||
return MergeFrom((OptionsMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(OptionsMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.OptionsMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasNormal) { |
||||
Normal = other.Normal; |
||||
} |
||||
if (other.HasOptionsMessage_) { |
||||
OptionsMessage_ = other.OptionsMessage_; |
||||
} |
||||
if (other.HasCustomName) { |
||||
CustomName = other.CustomName; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_optionsMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _optionsMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 10: { |
||||
result.hasNormal = input.ReadString(ref result.normal_); |
||||
break; |
||||
} |
||||
case 18: { |
||||
result.hasOptionsMessage_ = input.ReadString(ref result.optionsMessage_); |
||||
break; |
||||
} |
||||
case 26: { |
||||
result.hasCustomName = input.ReadString(ref result.customized_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasNormal { |
||||
get { return result.hasNormal; } |
||||
} |
||||
public string Normal { |
||||
get { return result.Normal; } |
||||
set { SetNormal(value); } |
||||
} |
||||
public Builder SetNormal(string value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.hasNormal = true; |
||||
result.normal_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearNormal() { |
||||
PrepareBuilder(); |
||||
result.hasNormal = false; |
||||
result.normal_ = ""; |
||||
return this; |
||||
} |
||||
|
||||
public bool HasOptionsMessage_ { |
||||
get { return result.hasOptionsMessage_; } |
||||
} |
||||
public string OptionsMessage_ { |
||||
get { return result.OptionsMessage_; } |
||||
set { SetOptionsMessage_(value); } |
||||
} |
||||
public Builder SetOptionsMessage_(string value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.hasOptionsMessage_ = true; |
||||
result.optionsMessage_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearOptionsMessage_() { |
||||
PrepareBuilder(); |
||||
result.hasOptionsMessage_ = false; |
||||
result.optionsMessage_ = ""; |
||||
return this; |
||||
} |
||||
|
||||
public bool HasCustomName { |
||||
get { return result.hasCustomName; } |
||||
} |
||||
public string CustomName { |
||||
get { return result.CustomName; } |
||||
set { SetCustomName(value); } |
||||
} |
||||
public Builder SetCustomName(string value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.hasCustomName = true; |
||||
result.customized_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearCustomName() { |
||||
PrepareBuilder(); |
||||
result.hasCustomName = false; |
||||
result.customized_ = ""; |
||||
return this; |
||||
} |
||||
} |
||||
static OptionsMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestCSharpOptionsProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,442 +0,0 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestEmbedOptimizeForProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder> internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestEmbedOptimizeForProtoFile() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CjFnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfZW1iZWRfb3B0aW1pemVfZm9y", |
||||
"LnByb3RvEhFwcm90b2J1Zl91bml0dGVzdBokZ29vZ2xlL3Byb3RvYnVmL2Nz", |
||||
"aGFycF9vcHRpb25zLnByb3RvGitnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rf", |
||||
"b3B0aW1pemVfZm9yLnByb3RvIqEBChlUZXN0RW1iZWRPcHRpbWl6ZWRGb3JT", |
||||
"aXplEkEKEG9wdGlvbmFsX21lc3NhZ2UYASABKAsyJy5wcm90b2J1Zl91bml0", |
||||
"dGVzdC5UZXN0T3B0aW1pemVkRm9yU2l6ZRJBChByZXBlYXRlZF9tZXNzYWdl", |
||||
"GAIgAygLMicucHJvdG9idWZfdW5pdHRlc3QuVGVzdE9wdGltaXplZEZvclNp", |
||||
"emVCS0gBwj5GCiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MS", |
||||
"IVVuaXRUZXN0RW1iZWRPcHRpbWl6ZUZvclByb3RvRmlsZQ==")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor, |
||||
new string[] { "OptionalMessage", "RepeatedMessage", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor, |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> { |
||||
private TestEmbedOptimizedForSize() { } |
||||
private static readonly TestEmbedOptimizedForSize defaultInstance = new TestEmbedOptimizedForSize().MakeReadOnly(); |
||||
private static readonly string[] _testEmbedOptimizedForSizeFieldNames = new string[] { "optional_message", "repeated_message" }; |
||||
private static readonly uint[] _testEmbedOptimizedForSizeFieldTags = new uint[] { 10, 18 }; |
||||
public static TestEmbedOptimizedForSize DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override TestEmbedOptimizedForSize DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override TestEmbedOptimizedForSize ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int OptionalMessageFieldNumber = 1; |
||||
private bool hasOptionalMessage; |
||||
private global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize optionalMessage_; |
||||
public bool HasOptionalMessage { |
||||
get { return hasOptionalMessage; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { |
||||
get { return optionalMessage_ ?? global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; } |
||||
} |
||||
|
||||
public const int RepeatedMessageFieldNumber = 2; |
||||
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> repeatedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize>(); |
||||
public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList { |
||||
get { return repeatedMessage_; } |
||||
} |
||||
public int RepeatedMessageCount { |
||||
get { return repeatedMessage_.Count; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { |
||||
return repeatedMessage_[index]; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
if (HasOptionalMessage) { |
||||
if (!OptionalMessage.IsInitialized) return false; |
||||
} |
||||
foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
||||
if (!element.IsInitialized) return false; |
||||
} |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _testEmbedOptimizedForSizeFieldNames; |
||||
if (hasOptionalMessage) { |
||||
output.WriteMessage(1, field_names[0], OptionalMessage); |
||||
} |
||||
if (repeatedMessage_.Count > 0) { |
||||
output.WriteMessageArray(2, field_names[1], repeatedMessage_); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasOptionalMessage) { |
||||
size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage); |
||||
} |
||||
foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
||||
size += pb::CodedOutputStream.ComputeMessageSize(2, element); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestEmbedOptimizedForSize ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private TestEmbedOptimizedForSize MakeReadOnly() { |
||||
repeatedMessage_.MakeReadOnly(); |
||||
return this; |
||||
} |
||||
|
||||
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(TestEmbedOptimizedForSize prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<TestEmbedOptimizedForSize, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(TestEmbedOptimizedForSize cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private TestEmbedOptimizedForSize result; |
||||
|
||||
private TestEmbedOptimizedForSize PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
TestEmbedOptimizedForSize original = result; |
||||
result = new TestEmbedOptimizedForSize(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override TestEmbedOptimizedForSize MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Descriptor; } |
||||
} |
||||
|
||||
public override TestEmbedOptimizedForSize DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance; } |
||||
} |
||||
|
||||
public override TestEmbedOptimizedForSize BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is TestEmbedOptimizedForSize) { |
||||
return MergeFrom((TestEmbedOptimizedForSize) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(TestEmbedOptimizedForSize other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasOptionalMessage) { |
||||
MergeOptionalMessage(other.OptionalMessage); |
||||
} |
||||
if (other.repeatedMessage_.Count != 0) { |
||||
result.repeatedMessage_.Add(other.repeatedMessage_); |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_testEmbedOptimizedForSizeFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _testEmbedOptimizedForSizeFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 10: { |
||||
global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(); |
||||
if (result.hasOptionalMessage) { |
||||
subBuilder.MergeFrom(OptionalMessage); |
||||
} |
||||
input.ReadMessage(subBuilder, extensionRegistry); |
||||
OptionalMessage = subBuilder.BuildPartial(); |
||||
break; |
||||
} |
||||
case 18: { |
||||
input.ReadMessageArray(tag, field_name, result.repeatedMessage_, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance, extensionRegistry); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasOptionalMessage { |
||||
get { return result.hasOptionalMessage; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { |
||||
get { return result.OptionalMessage; } |
||||
set { SetOptionalMessage(value); } |
||||
} |
||||
public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.hasOptionalMessage = true; |
||||
result.optionalMessage_ = value; |
||||
return this; |
||||
} |
||||
public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
||||
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
||||
PrepareBuilder(); |
||||
result.hasOptionalMessage = true; |
||||
result.optionalMessage_ = builderForValue.Build(); |
||||
return this; |
||||
} |
||||
public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
if (result.hasOptionalMessage && |
||||
result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance) { |
||||
result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial(); |
||||
} else { |
||||
result.optionalMessage_ = value; |
||||
} |
||||
result.hasOptionalMessage = true; |
||||
return this; |
||||
} |
||||
public Builder ClearOptionalMessage() { |
||||
PrepareBuilder(); |
||||
result.hasOptionalMessage = false; |
||||
result.optionalMessage_ = null; |
||||
return this; |
||||
} |
||||
|
||||
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList { |
||||
get { return PrepareBuilder().repeatedMessage_; } |
||||
} |
||||
public int RepeatedMessageCount { |
||||
get { return result.RepeatedMessageCount; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { |
||||
return result.GetRepeatedMessage(index); |
||||
} |
||||
public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.repeatedMessage_[index] = value; |
||||
return this; |
||||
} |
||||
public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
||||
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
||||
PrepareBuilder(); |
||||
result.repeatedMessage_[index] = builderForValue.Build(); |
||||
return this; |
||||
} |
||||
public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.repeatedMessage_.Add(value); |
||||
return this; |
||||
} |
||||
public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
||||
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
||||
PrepareBuilder(); |
||||
result.repeatedMessage_.Add(builderForValue.Build()); |
||||
return this; |
||||
} |
||||
public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> values) { |
||||
PrepareBuilder(); |
||||
result.repeatedMessage_.Add(values); |
||||
return this; |
||||
} |
||||
public Builder ClearRepeatedMessage() { |
||||
PrepareBuilder(); |
||||
result.repeatedMessage_.Clear(); |
||||
return this; |
||||
} |
||||
} |
||||
static TestEmbedOptimizedForSize() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,50 +0,0 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestEmptyProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestEmptyProtoFile() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CiRnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfZW1wdHkucHJvdG8aJGdvb2ds", |
||||
"ZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9ucy5wcm90b0I+wj47CiFHb29nbGUu", |
||||
"UHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MSFlVuaXRUZXN0RW1wdHlQcm90", |
||||
"b0ZpbGU=")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
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 |
||||
|
||||
} |
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,401 +0,0 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestExtrasProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt32Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt64Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint32Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint64Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint32Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint64Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed32Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed64Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed32Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed64Extension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFloatExtension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedDoubleExtension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedBoolExtension); |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedEnumExtension); |
||||
} |
||||
#endregion |
||||
#region Extensions |
||||
public const int UnpackedInt32ExtensionFieldNumber = 90; |
||||
public static pb::GeneratedExtensionBase<scg::IList<int>> UnpackedInt32Extension; |
||||
public const int UnpackedInt64ExtensionFieldNumber = 91; |
||||
public static pb::GeneratedExtensionBase<scg::IList<long>> UnpackedInt64Extension; |
||||
public const int UnpackedUint32ExtensionFieldNumber = 92; |
||||
[global::System.CLSCompliant(false)] |
||||
public static pb::GeneratedExtensionBase<scg::IList<uint>> UnpackedUint32Extension; |
||||
public const int UnpackedUint64ExtensionFieldNumber = 93; |
||||
[global::System.CLSCompliant(false)] |
||||
public static pb::GeneratedExtensionBase<scg::IList<ulong>> UnpackedUint64Extension; |
||||
public const int UnpackedSint32ExtensionFieldNumber = 94; |
||||
public static pb::GeneratedExtensionBase<scg::IList<int>> UnpackedSint32Extension; |
||||
public const int UnpackedSint64ExtensionFieldNumber = 95; |
||||
public static pb::GeneratedExtensionBase<scg::IList<long>> UnpackedSint64Extension; |
||||
public const int UnpackedFixed32ExtensionFieldNumber = 96; |
||||
[global::System.CLSCompliant(false)] |
||||
public static pb::GeneratedExtensionBase<scg::IList<uint>> UnpackedFixed32Extension; |
||||
public const int UnpackedFixed64ExtensionFieldNumber = 97; |
||||
[global::System.CLSCompliant(false)] |
||||
public static pb::GeneratedExtensionBase<scg::IList<ulong>> UnpackedFixed64Extension; |
||||
public const int UnpackedSfixed32ExtensionFieldNumber = 98; |
||||
public static pb::GeneratedExtensionBase<scg::IList<int>> UnpackedSfixed32Extension; |
||||
public const int UnpackedSfixed64ExtensionFieldNumber = 99; |
||||
public static pb::GeneratedExtensionBase<scg::IList<long>> UnpackedSfixed64Extension; |
||||
public const int UnpackedFloatExtensionFieldNumber = 100; |
||||
public static pb::GeneratedExtensionBase<scg::IList<float>> UnpackedFloatExtension; |
||||
public const int UnpackedDoubleExtensionFieldNumber = 101; |
||||
public static pb::GeneratedExtensionBase<scg::IList<double>> UnpackedDoubleExtension; |
||||
public const int UnpackedBoolExtensionFieldNumber = 102; |
||||
public static pb::GeneratedExtensionBase<scg::IList<bool>> UnpackedBoolExtension; |
||||
public const int UnpackedEnumExtensionFieldNumber = 103; |
||||
public static pb::GeneratedExtensionBase<scg::IList<global::Google.ProtocolBuffers.TestProtos.UnpackedExtensionsForeignEnum>> UnpackedEnumExtension; |
||||
#endregion |
||||
|
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions, global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.Builder> internal__static_protobuf_unittest_extra_TestUnpackedExtensions__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestExtrasProtoFile() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"ChxleHRlc3QvdW5pdHRlc3RfZXh0cmFzLnByb3RvEhdwcm90b2J1Zl91bml0", |
||||
"dGVzdF9leHRyYRokZ29vZ2xlL3Byb3RvYnVmL2NzaGFycF9vcHRpb25zLnBy", |
||||
"b3RvIiIKFlRlc3RVbnBhY2tlZEV4dGVuc2lvbnMqCAgBEICAgIACKlIKHVVu", |
||||
"cGFja2VkRXh0ZW5zaW9uc0ZvcmVpZ25FbnVtEg8KC0ZPUkVJR05fRk9PEAQS", |
||||
"DwoLRk9SRUlHTl9CQVIQBRIPCgtGT1JFSUdOX0JBWhAGOlEKGHVucGFja2Vk", |
||||
"X2ludDMyX2V4dGVuc2lvbhIvLnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRl", |
||||
"c3RVbnBhY2tlZEV4dGVuc2lvbnMYWiADKAU6UQoYdW5wYWNrZWRfaW50NjRf", |
||||
"ZXh0ZW5zaW9uEi8ucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFj", |
||||
"a2VkRXh0ZW5zaW9ucxhbIAMoAzpSChl1bnBhY2tlZF91aW50MzJfZXh0ZW5z", |
||||
"aW9uEi8ucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0", |
||||
"ZW5zaW9ucxhcIAMoDTpSChl1bnBhY2tlZF91aW50NjRfZXh0ZW5zaW9uEi8u", |
||||
"cHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9u", |
||||
"cxhdIAMoBDpSChl1bnBhY2tlZF9zaW50MzJfZXh0ZW5zaW9uEi8ucHJvdG9i", |
||||
"dWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxheIAMo", |
||||
"ETpSChl1bnBhY2tlZF9zaW50NjRfZXh0ZW5zaW9uEi8ucHJvdG9idWZfdW5p", |
||||
"dHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxhfIAMoEjpTChp1", |
||||
"bnBhY2tlZF9maXhlZDMyX2V4dGVuc2lvbhIvLnByb3RvYnVmX3VuaXR0ZXN0", |
||||
"X2V4dHJhLlRlc3RVbnBhY2tlZEV4dGVuc2lvbnMYYCADKAc6UwoadW5wYWNr", |
||||
"ZWRfZml4ZWQ2NF9leHRlbnNpb24SLy5wcm90b2J1Zl91bml0dGVzdF9leHRy", |
||||
"YS5UZXN0VW5wYWNrZWRFeHRlbnNpb25zGGEgAygGOlQKG3VucGFja2VkX3Nm", |
||||
"aXhlZDMyX2V4dGVuc2lvbhIvLnByb3RvYnVmX3VuaXR0ZXN0X2V4dHJhLlRl", |
||||
"c3RVbnBhY2tlZEV4dGVuc2lvbnMYYiADKA86VAobdW5wYWNrZWRfc2ZpeGVk", |
||||
"NjRfZXh0ZW5zaW9uEi8ucHJvdG9idWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVu", |
||||
"cGFja2VkRXh0ZW5zaW9ucxhjIAMoEDpRChh1bnBhY2tlZF9mbG9hdF9leHRl", |
||||
"bnNpb24SLy5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0VW5wYWNrZWRF", |
||||
"eHRlbnNpb25zGGQgAygCOlIKGXVucGFja2VkX2RvdWJsZV9leHRlbnNpb24S", |
||||
"Ly5wcm90b2J1Zl91bml0dGVzdF9leHRyYS5UZXN0VW5wYWNrZWRFeHRlbnNp", |
||||
"b25zGGUgAygBOlAKF3VucGFja2VkX2Jvb2xfZXh0ZW5zaW9uEi8ucHJvdG9i", |
||||
"dWZfdW5pdHRlc3RfZXh0cmEuVGVzdFVucGFja2VkRXh0ZW5zaW9ucxhmIAMo", |
||||
"CDqIAQoXdW5wYWNrZWRfZW51bV9leHRlbnNpb24SLy5wcm90b2J1Zl91bml0", |
||||
"dGVzdF9leHRyYS5UZXN0VW5wYWNrZWRFeHRlbnNpb25zGGcgAygOMjYucHJv", |
||||
"dG9idWZfdW5pdHRlc3RfZXh0cmEuVW5wYWNrZWRFeHRlbnNpb25zRm9yZWln", |
||||
"bkVudW1CVgoTY29tLmdvb2dsZS5wcm90b2J1ZsI+PgohR29vZ2xlLlByb3Rv", |
||||
"Y29sQnVmZmVycy5UZXN0UHJvdG9zEhdVbml0VGVzdEV4dHJhc1Byb3RvRmls", |
||||
"ZUgB")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_extra_TestUnpackedExtensions__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions, global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.Builder>(internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor, |
||||
new string[] { }); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt32Extension = pb::GeneratedRepeatExtension<int>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[0]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedInt64Extension = pb::GeneratedRepeatExtension<long>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[1]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint32Extension = pb::GeneratedRepeatExtension<uint>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[2]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedUint64Extension = pb::GeneratedRepeatExtension<ulong>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[3]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint32Extension = pb::GeneratedRepeatExtension<int>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[4]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSint64Extension = pb::GeneratedRepeatExtension<long>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[5]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed32Extension = pb::GeneratedRepeatExtension<uint>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[6]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFixed64Extension = pb::GeneratedRepeatExtension<ulong>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[7]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed32Extension = pb::GeneratedRepeatExtension<int>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[8]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedSfixed64Extension = pb::GeneratedRepeatExtension<long>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[9]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedFloatExtension = pb::GeneratedRepeatExtension<float>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[10]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedDoubleExtension = pb::GeneratedRepeatExtension<double>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[11]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedBoolExtension = pb::GeneratedRepeatExtension<bool>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[12]); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.UnpackedEnumExtension = pb::GeneratedRepeatExtension<global::Google.ProtocolBuffers.TestProtos.UnpackedExtensionsForeignEnum>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor.Extensions[13]); |
||||
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 |
||||
public enum UnpackedExtensionsForeignEnum { |
||||
FOREIGN_FOO = 4, |
||||
FOREIGN_BAR = 5, |
||||
FOREIGN_BAZ = 6, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.SerializableAttribute()] |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class TestUnpackedExtensions : pb::ExtendableMessage<TestUnpackedExtensions, TestUnpackedExtensions.Builder> { |
||||
private TestUnpackedExtensions() { } |
||||
private static readonly TestUnpackedExtensions defaultInstance = new TestUnpackedExtensions().MakeReadOnly(); |
||||
private static readonly string[] _testUnpackedExtensionsFieldNames = new string[] { }; |
||||
private static readonly uint[] _testUnpackedExtensionsFieldTags = new uint[] { }; |
||||
public static TestUnpackedExtensions DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override TestUnpackedExtensions DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override TestUnpackedExtensions ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.internal__static_protobuf_unittest_extra_TestUnpackedExtensions__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<TestUnpackedExtensions, TestUnpackedExtensions.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.internal__static_protobuf_unittest_extra_TestUnpackedExtensions__FieldAccessorTable; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
if (!ExtensionsAreInitialized) return false; |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _testUnpackedExtensionsFieldNames; |
||||
pb::ExtendableMessage<TestUnpackedExtensions, TestUnpackedExtensions.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this); |
||||
extensionWriter.WriteUntil(536870912, output); |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
size += ExtensionsSerializedSize; |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestUnpackedExtensions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private TestUnpackedExtensions MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(TestUnpackedExtensions prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.SerializableAttribute()] |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::ExtendableBuilder<TestUnpackedExtensions, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(TestUnpackedExtensions cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private TestUnpackedExtensions result; |
||||
|
||||
private TestUnpackedExtensions PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
TestUnpackedExtensions original = result; |
||||
result = new TestUnpackedExtensions(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override TestUnpackedExtensions MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.Descriptor; } |
||||
} |
||||
|
||||
public override TestUnpackedExtensions DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.DefaultInstance; } |
||||
} |
||||
|
||||
public override TestUnpackedExtensions BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is TestUnpackedExtensions) { |
||||
return MergeFrom((TestUnpackedExtensions) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(TestUnpackedExtensions other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.TestUnpackedExtensions.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
this.MergeExtensionFields(other); |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_testUnpackedExtensionsFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _testUnpackedExtensionsFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
} |
||||
static TestUnpackedExtensions() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestExtrasProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,260 +0,0 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestGenericServices { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestGenericServices() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CiZleHRlc3QvdW5pdHRlc3RfZ2VuZXJpY19zZXJ2aWNlcy5wcm90bxIRcHJv", |
||||
"dG9idWZfdW5pdHRlc3QaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9u", |
||||
"cy5wcm90bxoeZ29vZ2xlL3Byb3RvYnVmL3VuaXR0ZXN0LnByb3RvGi1nb29n", |
||||
"bGUvcHJvdG9idWYvdW5pdHRlc3RfY3VzdG9tX29wdGlvbnMucHJvdG8yoAEK", |
||||
"ElRlc3RHZW5lcmljU2VydmljZRJECgNGb28SHS5wcm90b2J1Zl91bml0dGVz", |
||||
"dC5Gb29SZXF1ZXN0Gh4ucHJvdG9idWZfdW5pdHRlc3QuRm9vUmVzcG9uc2US", |
||||
"RAoDQmFyEh0ucHJvdG9idWZfdW5pdHRlc3QuQmFyUmVxdWVzdBoeLnByb3Rv", |
||||
"YnVmX3VuaXR0ZXN0LkJhclJlc3BvbnNlMpUBCiNUZXN0R2VuZXJpY1NlcnZp", |
||||
"Y2VXaXRoQ3VzdG9tT3B0aW9ucxJjCgNGb28SKS5wcm90b2J1Zl91bml0dGVz", |
||||
"dC5DdXN0b21PcHRpb25Gb29SZXF1ZXN0GioucHJvdG9idWZfdW5pdHRlc3Qu", |
||||
"Q3VzdG9tT3B0aW9uRm9vUmVzcG9uc2UiBeD6jB4CGgmQsose09uAy0lCREgB", |
||||
"wj4/CiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MSF1VuaXRU", |
||||
"ZXN0R2VuZXJpY1NlcnZpY2VziA4B")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RegisterAllExtensions(registry); |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor, |
||||
global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor, |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Services |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public abstract class TestGenericService : pb::IService { |
||||
public abstract void Foo( |
||||
pb::IRpcController controller, |
||||
global::Google.ProtocolBuffers.TestProtos.FooRequest request, |
||||
global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done); |
||||
public abstract void Bar( |
||||
pb::IRpcController controller, |
||||
global::Google.ProtocolBuffers.TestProtos.BarRequest request, |
||||
global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done); |
||||
|
||||
public static pbd::ServiceDescriptor Descriptor { |
||||
get { return UnitTestGenericServices.Descriptor.Services[0]; } |
||||
} |
||||
public pbd::ServiceDescriptor DescriptorForType { |
||||
get { return Descriptor; } |
||||
} |
||||
|
||||
public void CallMethod( |
||||
pbd::MethodDescriptor method, |
||||
pb::IRpcController controller, |
||||
pb::IMessage request, |
||||
global::System.Action<pb::IMessage> done) { |
||||
if (method.Service != Descriptor) { |
||||
throw new global::System.ArgumentException( |
||||
"Service.CallMethod() given method descriptor for wrong service type."); |
||||
} |
||||
switch(method.Index) { |
||||
case 0: |
||||
this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.FooRequest) request, |
||||
pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse>( |
||||
done)); |
||||
return; |
||||
case 1: |
||||
this.Bar(controller, (global::Google.ProtocolBuffers.TestProtos.BarRequest) request, |
||||
pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse>( |
||||
done)); |
||||
return; |
||||
default: |
||||
throw new global::System.InvalidOperationException("Can't get here."); |
||||
} |
||||
} |
||||
|
||||
public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { |
||||
if (method.Service != Descriptor) { |
||||
throw new global::System.ArgumentException( |
||||
"Service.GetRequestPrototype() given method descriptor for wrong service type."); |
||||
} |
||||
switch(method.Index) { |
||||
case 0: |
||||
return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance; |
||||
case 1: |
||||
return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance; |
||||
default: |
||||
throw new global::System.InvalidOperationException("Can't get here."); |
||||
} |
||||
} |
||||
|
||||
public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { |
||||
if (method.Service != Descriptor) { |
||||
throw new global::System.ArgumentException( |
||||
"Service.GetResponsePrototype() given method descriptor for wrong service type."); |
||||
} |
||||
switch(method.Index) { |
||||
case 0: |
||||
return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance; |
||||
case 1: |
||||
return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance; |
||||
default: |
||||
throw new global::System.InvalidOperationException("Can't get here."); |
||||
} |
||||
} |
||||
|
||||
public static Stub CreateStub(pb::IRpcChannel channel) { |
||||
return new Stub(channel); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericService { |
||||
internal Stub(pb::IRpcChannel channel) { |
||||
this.channel = channel; |
||||
} |
||||
|
||||
private readonly pb::IRpcChannel channel; |
||||
|
||||
public pb::IRpcChannel Channel { |
||||
get { return channel; } |
||||
} |
||||
|
||||
public override void Foo( |
||||
pb::IRpcController controller, |
||||
global::Google.ProtocolBuffers.TestProtos.FooRequest request, |
||||
global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done) { |
||||
channel.CallMethod(Descriptor.Methods[0], |
||||
controller, request, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance, |
||||
pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse, global::Google.ProtocolBuffers.TestProtos.FooResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance)); |
||||
} |
||||
|
||||
public override void Bar( |
||||
pb::IRpcController controller, |
||||
global::Google.ProtocolBuffers.TestProtos.BarRequest request, |
||||
global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done) { |
||||
channel.CallMethod(Descriptor.Methods[1], |
||||
controller, request, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance, |
||||
pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse, global::Google.ProtocolBuffers.TestProtos.BarResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance)); |
||||
} |
||||
} |
||||
} |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public abstract class TestGenericServiceWithCustomOptions : pb::IService { |
||||
public abstract void Foo( |
||||
pb::IRpcController controller, |
||||
global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request, |
||||
global::System.Action<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse> done); |
||||
|
||||
public static pbd::ServiceDescriptor Descriptor { |
||||
get { return UnitTestGenericServices.Descriptor.Services[1]; } |
||||
} |
||||
public pbd::ServiceDescriptor DescriptorForType { |
||||
get { return Descriptor; } |
||||
} |
||||
|
||||
public void CallMethod( |
||||
pbd::MethodDescriptor method, |
||||
pb::IRpcController controller, |
||||
pb::IMessage request, |
||||
global::System.Action<pb::IMessage> done) { |
||||
if (method.Service != Descriptor) { |
||||
throw new global::System.ArgumentException( |
||||
"Service.CallMethod() given method descriptor for wrong service type."); |
||||
} |
||||
switch(method.Index) { |
||||
case 0: |
||||
this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest) request, |
||||
pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse>( |
||||
done)); |
||||
return; |
||||
default: |
||||
throw new global::System.InvalidOperationException("Can't get here."); |
||||
} |
||||
} |
||||
|
||||
public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { |
||||
if (method.Service != Descriptor) { |
||||
throw new global::System.ArgumentException( |
||||
"Service.GetRequestPrototype() given method descriptor for wrong service type."); |
||||
} |
||||
switch(method.Index) { |
||||
case 0: |
||||
return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest.DefaultInstance; |
||||
default: |
||||
throw new global::System.InvalidOperationException("Can't get here."); |
||||
} |
||||
} |
||||
|
||||
public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { |
||||
if (method.Service != Descriptor) { |
||||
throw new global::System.ArgumentException( |
||||
"Service.GetResponsePrototype() given method descriptor for wrong service type."); |
||||
} |
||||
switch(method.Index) { |
||||
case 0: |
||||
return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance; |
||||
default: |
||||
throw new global::System.InvalidOperationException("Can't get here."); |
||||
} |
||||
} |
||||
|
||||
public static Stub CreateStub(pb::IRpcChannel channel) { |
||||
return new Stub(channel); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericServiceWithCustomOptions { |
||||
internal Stub(pb::IRpcChannel channel) { |
||||
this.channel = channel; |
||||
} |
||||
|
||||
private readonly pb::IRpcChannel channel; |
||||
|
||||
public pb::IRpcChannel Channel { |
||||
get { return channel; } |
||||
} |
||||
|
||||
public override void Foo( |
||||
pb::IRpcController controller, |
||||
global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request, |
||||
global::System.Action<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse> done) { |
||||
channel.CallMethod(Descriptor.Methods[0], |
||||
controller, request, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance, |
||||
pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance)); |
||||
} |
||||
} |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,368 +0,0 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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.NoGenericService { |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public static partial class UnitTestNoGenericServicesProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
registry.Add(global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.TestExtension); |
||||
} |
||||
#endregion |
||||
#region Extensions |
||||
public const int TestExtensionFieldNumber = 1000; |
||||
public static pb::GeneratedExtensionBase<int> TestExtension; |
||||
#endregion |
||||
|
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage, global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.Builder> internal__static_google_protobuf_no_generic_services_test_TestMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestNoGenericServicesProtoFile() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CjJnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfbm9fZ2VuZXJpY19zZXJ2aWNl", |
||||
"cy5wcm90bxIoZ29vZ2xlLnByb3RvYnVmLm5vX2dlbmVyaWNfc2VydmljZXNf", |
||||
"dGVzdBokZ29vZ2xlL3Byb3RvYnVmL2NzaGFycF9vcHRpb25zLnByb3RvIiMK", |
||||
"C1Rlc3RNZXNzYWdlEgkKAWEYASABKAUqCQjoBxCAgICAAioTCghUZXN0RW51", |
||||
"bRIHCgNGT08QATKCAQoLVGVzdFNlcnZpY2UScwoDRm9vEjUuZ29vZ2xlLnBy", |
||||
"b3RvYnVmLm5vX2dlbmVyaWNfc2VydmljZXNfdGVzdC5UZXN0TWVzc2FnZRo1", |
||||
"Lmdvb2dsZS5wcm90b2J1Zi5ub19nZW5lcmljX3NlcnZpY2VzX3Rlc3QuVGVz", |
||||
"dE1lc3NhZ2U6TgoOdGVzdF9leHRlbnNpb24SNS5nb29nbGUucHJvdG9idWYu", |
||||
"bm9fZ2VuZXJpY19zZXJ2aWNlc190ZXN0LlRlc3RNZXNzYWdlGOgHIAEoBUJb", |
||||
"wj5YCjJHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MuTm9HZW5l", |
||||
"cmljU2VydmljZRIiVW5pdFRlc3ROb0dlbmVyaWNTZXJ2aWNlc1Byb3RvRmls", |
||||
"ZQ==")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_google_protobuf_no_generic_services_test_TestMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage, global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.Builder>(internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor, |
||||
new string[] { "A", }); |
||||
global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.TestExtension = pb::GeneratedSingleExtension<int>.CreateInstance(global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.Descriptor.Extensions[0]); |
||||
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 |
||||
public enum TestEnum { |
||||
FOO = 1, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class TestMessage : pb::ExtendableMessage<TestMessage, TestMessage.Builder> { |
||||
private TestMessage() { } |
||||
private static readonly TestMessage defaultInstance = new TestMessage().MakeReadOnly(); |
||||
private static readonly string[] _testMessageFieldNames = new string[] { "a" }; |
||||
private static readonly uint[] _testMessageFieldTags = new uint[] { 8 }; |
||||
public static TestMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override TestMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override TestMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.internal__static_google_protobuf_no_generic_services_test_TestMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<TestMessage, TestMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.internal__static_google_protobuf_no_generic_services_test_TestMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int AFieldNumber = 1; |
||||
private bool hasA; |
||||
private int a_; |
||||
public bool HasA { |
||||
get { return hasA; } |
||||
} |
||||
public int A { |
||||
get { return a_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
if (!ExtensionsAreInitialized) return false; |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _testMessageFieldNames; |
||||
pb::ExtendableMessage<TestMessage, TestMessage.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this); |
||||
if (hasA) { |
||||
output.WriteInt32(1, field_names[0], A); |
||||
} |
||||
extensionWriter.WriteUntil(536870912, output); |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasA) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, A); |
||||
} |
||||
size += ExtensionsSerializedSize; |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static TestMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private TestMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(TestMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::ExtendableBuilder<TestMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(TestMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private TestMessage result; |
||||
|
||||
private TestMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
TestMessage original = result; |
||||
result = new TestMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override TestMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.Descriptor; } |
||||
} |
||||
|
||||
public override TestMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override TestMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is TestMessage) { |
||||
return MergeFrom((TestMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(TestMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasA) { |
||||
A = other.A; |
||||
} |
||||
this.MergeExtensionFields(other); |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_testMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _testMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasA = input.ReadInt32(ref result.a_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasA { |
||||
get { return result.hasA; } |
||||
} |
||||
public int A { |
||||
get { return result.A; } |
||||
set { SetA(value); } |
||||
} |
||||
public Builder SetA(int value) { |
||||
PrepareBuilder(); |
||||
result.hasA = true; |
||||
result.a_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearA() { |
||||
PrepareBuilder(); |
||||
result.hasA = false; |
||||
result.a_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static TestMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.NoGenericService.UnitTestNoGenericServicesProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Services |
||||
/* |
||||
* Service generation is now disabled by default, use the following option to enable: |
||||
* option (google.protobuf.csharp_file_options).service_generator_type = GENERIC; |
||||
*/ |
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,791 @@ |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_drop_unknown_fields.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestDropUnknownFields { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_unittest_drop_unknown_fields_Foo__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Foo, global::Google.ProtocolBuffers.TestProtos.Foo.Builder> internal__static_unittest_drop_unknown_fields_Foo__FieldAccessorTable; |
||||
internal static pbd::MessageDescriptor internal__static_unittest_drop_unknown_fields_FooWithExtraFields__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields, global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Builder> internal__static_unittest_drop_unknown_fields_FooWithExtraFields__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnittestDropUnknownFields() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CjJnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfZHJvcF91bmtub3duX2ZpZWxk", |
||||
"cy5wcm90bxIcdW5pdHRlc3RfZHJvcF91bmtub3duX2ZpZWxkcyKFAQoDRm9v", |
||||
"EhMKC2ludDMyX3ZhbHVlGAEgASgFEkAKCmVudW1fdmFsdWUYAiABKA4yLC51", |
||||
"bml0dGVzdF9kcm9wX3Vua25vd25fZmllbGRzLkZvby5OZXN0ZWRFbnVtIicK", |
||||
"Ck5lc3RlZEVudW0SBwoDRk9PEAASBwoDQkFSEAESBwoDQkFaEAIixwEKEkZv", |
||||
"b1dpdGhFeHRyYUZpZWxkcxITCgtpbnQzMl92YWx1ZRgBIAEoBRJPCgplbnVt", |
||||
"X3ZhbHVlGAIgASgOMjsudW5pdHRlc3RfZHJvcF91bmtub3duX2ZpZWxkcy5G", |
||||
"b29XaXRoRXh0cmFGaWVsZHMuTmVzdGVkRW51bRIZChFleHRyYV9pbnQzMl92", |
||||
"YWx1ZRgDIAEoBSIwCgpOZXN0ZWRFbnVtEgcKA0ZPTxAAEgcKA0JBUhABEgcK", |
||||
"A0JBWhACEgcKA1FVWBADQiSqAiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRl", |
||||
"c3RQcm90b3NiBnByb3RvMw==")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_unittest_drop_unknown_fields_Foo__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_unittest_drop_unknown_fields_Foo__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.Foo, global::Google.ProtocolBuffers.TestProtos.Foo.Builder>(internal__static_unittest_drop_unknown_fields_Foo__Descriptor, |
||||
new string[] { "Int32Value", "EnumValue", }); |
||||
internal__static_unittest_drop_unknown_fields_FooWithExtraFields__Descriptor = Descriptor.MessageTypes[1]; |
||||
internal__static_unittest_drop_unknown_fields_FooWithExtraFields__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields, global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Builder>(internal__static_unittest_drop_unknown_fields_FooWithExtraFields__Descriptor, |
||||
new string[] { "Int32Value", "EnumValue", "ExtraInt32Value", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Foo : pb::GeneratedMessage<Foo, Foo.Builder> { |
||||
private Foo() { } |
||||
private static readonly Foo defaultInstance = new Foo().MakeReadOnly(); |
||||
private static readonly string[] _fooFieldNames = new string[] { "enum_value", "int32_value" }; |
||||
private static readonly uint[] _fooFieldTags = new uint[] { 16, 8 }; |
||||
public static Foo DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override Foo DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override Foo ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestDropUnknownFields.internal__static_unittest_drop_unknown_fields_Foo__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<Foo, Foo.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestDropUnknownFields.internal__static_unittest_drop_unknown_fields_Foo__FieldAccessorTable; } |
||||
} |
||||
|
||||
#region Nested types |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public static partial class Types { |
||||
public enum NestedEnum { |
||||
FOO = 0, |
||||
BAR = 1, |
||||
BAZ = 2, |
||||
} |
||||
|
||||
} |
||||
#endregion |
||||
|
||||
public const int Int32ValueFieldNumber = 1; |
||||
private bool hasInt32Value; |
||||
private int int32Value_; |
||||
public bool HasInt32Value { |
||||
get { return hasInt32Value; } |
||||
} |
||||
public int Int32Value { |
||||
get { return int32Value_; } |
||||
} |
||||
|
||||
public const int EnumValueFieldNumber = 2; |
||||
private bool hasEnumValue; |
||||
private global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum enumValue_ = global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum.FOO; |
||||
public bool HasEnumValue { |
||||
get { return hasEnumValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum EnumValue { |
||||
get { return enumValue_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _fooFieldNames; |
||||
if (hasInt32Value) { |
||||
output.WriteInt32(1, field_names[1], Int32Value); |
||||
} |
||||
if (hasEnumValue) { |
||||
output.WriteEnum(2, field_names[0], (int) EnumValue, EnumValue); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasInt32Value) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, Int32Value); |
||||
} |
||||
if (hasEnumValue) { |
||||
size += pb::CodedOutputStream.ComputeEnumSize(2, (int) EnumValue); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static Foo ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static Foo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static Foo ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static Foo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static Foo ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static Foo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static Foo ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static Foo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static Foo ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static Foo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private Foo MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(Foo prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<Foo, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(Foo cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private Foo result; |
||||
|
||||
private Foo PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
Foo original = result; |
||||
result = new Foo(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override Foo MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.Foo.Descriptor; } |
||||
} |
||||
|
||||
public override Foo DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.Foo.DefaultInstance; } |
||||
} |
||||
|
||||
public override Foo BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is Foo) { |
||||
return MergeFrom((Foo) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(Foo other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.Foo.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasInt32Value) { |
||||
Int32Value = other.Int32Value; |
||||
} |
||||
if (other.HasEnumValue) { |
||||
EnumValue = other.EnumValue; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_fooFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _fooFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasInt32Value = input.ReadInt32(ref result.int32Value_); |
||||
break; |
||||
} |
||||
case 16: { |
||||
object unknown; |
||||
if(input.ReadEnum(ref result.enumValue_, out unknown)) { |
||||
result.hasEnumValue = true; |
||||
} else if(unknown is int) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
unknownFields.MergeVarintField(2, (ulong)(int)unknown); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasInt32Value { |
||||
get { return result.hasInt32Value; } |
||||
} |
||||
public int Int32Value { |
||||
get { return result.Int32Value; } |
||||
set { SetInt32Value(value); } |
||||
} |
||||
public Builder SetInt32Value(int value) { |
||||
PrepareBuilder(); |
||||
result.hasInt32Value = true; |
||||
result.int32Value_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearInt32Value() { |
||||
PrepareBuilder(); |
||||
result.hasInt32Value = false; |
||||
result.int32Value_ = 0; |
||||
return this; |
||||
} |
||||
|
||||
public bool HasEnumValue { |
||||
get { return result.hasEnumValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum EnumValue { |
||||
get { return result.EnumValue; } |
||||
set { SetEnumValue(value); } |
||||
} |
||||
public Builder SetEnumValue(global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum value) { |
||||
PrepareBuilder(); |
||||
result.hasEnumValue = true; |
||||
result.enumValue_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearEnumValue() { |
||||
PrepareBuilder(); |
||||
result.hasEnumValue = false; |
||||
result.enumValue_ = global::Google.ProtocolBuffers.TestProtos.Foo.Types.NestedEnum.FOO; |
||||
return this; |
||||
} |
||||
} |
||||
static Foo() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestDropUnknownFields.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class FooWithExtraFields : pb::GeneratedMessage<FooWithExtraFields, FooWithExtraFields.Builder> { |
||||
private FooWithExtraFields() { } |
||||
private static readonly FooWithExtraFields defaultInstance = new FooWithExtraFields().MakeReadOnly(); |
||||
private static readonly string[] _fooWithExtraFieldsFieldNames = new string[] { "enum_value", "extra_int32_value", "int32_value" }; |
||||
private static readonly uint[] _fooWithExtraFieldsFieldTags = new uint[] { 16, 24, 8 }; |
||||
public static FooWithExtraFields DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override FooWithExtraFields DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override FooWithExtraFields ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestDropUnknownFields.internal__static_unittest_drop_unknown_fields_FooWithExtraFields__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<FooWithExtraFields, FooWithExtraFields.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestDropUnknownFields.internal__static_unittest_drop_unknown_fields_FooWithExtraFields__FieldAccessorTable; } |
||||
} |
||||
|
||||
#region Nested types |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public static partial class Types { |
||||
public enum NestedEnum { |
||||
FOO = 0, |
||||
BAR = 1, |
||||
BAZ = 2, |
||||
QUX = 3, |
||||
} |
||||
|
||||
} |
||||
#endregion |
||||
|
||||
public const int Int32ValueFieldNumber = 1; |
||||
private bool hasInt32Value; |
||||
private int int32Value_; |
||||
public bool HasInt32Value { |
||||
get { return hasInt32Value; } |
||||
} |
||||
public int Int32Value { |
||||
get { return int32Value_; } |
||||
} |
||||
|
||||
public const int EnumValueFieldNumber = 2; |
||||
private bool hasEnumValue; |
||||
private global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum enumValue_ = global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum.FOO; |
||||
public bool HasEnumValue { |
||||
get { return hasEnumValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum EnumValue { |
||||
get { return enumValue_; } |
||||
} |
||||
|
||||
public const int ExtraInt32ValueFieldNumber = 3; |
||||
private bool hasExtraInt32Value; |
||||
private int extraInt32Value_; |
||||
public bool HasExtraInt32Value { |
||||
get { return hasExtraInt32Value; } |
||||
} |
||||
public int ExtraInt32Value { |
||||
get { return extraInt32Value_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _fooWithExtraFieldsFieldNames; |
||||
if (hasInt32Value) { |
||||
output.WriteInt32(1, field_names[2], Int32Value); |
||||
} |
||||
if (hasEnumValue) { |
||||
output.WriteEnum(2, field_names[0], (int) EnumValue, EnumValue); |
||||
} |
||||
if (hasExtraInt32Value) { |
||||
output.WriteInt32(3, field_names[1], ExtraInt32Value); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasInt32Value) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, Int32Value); |
||||
} |
||||
if (hasEnumValue) { |
||||
size += pb::CodedOutputStream.ComputeEnumSize(2, (int) EnumValue); |
||||
} |
||||
if (hasExtraInt32Value) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(3, ExtraInt32Value); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static FooWithExtraFields ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static FooWithExtraFields ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private FooWithExtraFields MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(FooWithExtraFields prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<FooWithExtraFields, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(FooWithExtraFields cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private FooWithExtraFields result; |
||||
|
||||
private FooWithExtraFields PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
FooWithExtraFields original = result; |
||||
result = new FooWithExtraFields(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override FooWithExtraFields MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Descriptor; } |
||||
} |
||||
|
||||
public override FooWithExtraFields DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.DefaultInstance; } |
||||
} |
||||
|
||||
public override FooWithExtraFields BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is FooWithExtraFields) { |
||||
return MergeFrom((FooWithExtraFields) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(FooWithExtraFields other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasInt32Value) { |
||||
Int32Value = other.Int32Value; |
||||
} |
||||
if (other.HasEnumValue) { |
||||
EnumValue = other.EnumValue; |
||||
} |
||||
if (other.HasExtraInt32Value) { |
||||
ExtraInt32Value = other.ExtraInt32Value; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_fooWithExtraFieldsFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _fooWithExtraFieldsFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasInt32Value = input.ReadInt32(ref result.int32Value_); |
||||
break; |
||||
} |
||||
case 16: { |
||||
object unknown; |
||||
if(input.ReadEnum(ref result.enumValue_, out unknown)) { |
||||
result.hasEnumValue = true; |
||||
} else if(unknown is int) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
unknownFields.MergeVarintField(2, (ulong)(int)unknown); |
||||
} |
||||
break; |
||||
} |
||||
case 24: { |
||||
result.hasExtraInt32Value = input.ReadInt32(ref result.extraInt32Value_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasInt32Value { |
||||
get { return result.hasInt32Value; } |
||||
} |
||||
public int Int32Value { |
||||
get { return result.Int32Value; } |
||||
set { SetInt32Value(value); } |
||||
} |
||||
public Builder SetInt32Value(int value) { |
||||
PrepareBuilder(); |
||||
result.hasInt32Value = true; |
||||
result.int32Value_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearInt32Value() { |
||||
PrepareBuilder(); |
||||
result.hasInt32Value = false; |
||||
result.int32Value_ = 0; |
||||
return this; |
||||
} |
||||
|
||||
public bool HasEnumValue { |
||||
get { return result.hasEnumValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum EnumValue { |
||||
get { return result.EnumValue; } |
||||
set { SetEnumValue(value); } |
||||
} |
||||
public Builder SetEnumValue(global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum value) { |
||||
PrepareBuilder(); |
||||
result.hasEnumValue = true; |
||||
result.enumValue_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearEnumValue() { |
||||
PrepareBuilder(); |
||||
result.hasEnumValue = false; |
||||
result.enumValue_ = global::Google.ProtocolBuffers.TestProtos.FooWithExtraFields.Types.NestedEnum.FOO; |
||||
return this; |
||||
} |
||||
|
||||
public bool HasExtraInt32Value { |
||||
get { return result.hasExtraInt32Value; } |
||||
} |
||||
public int ExtraInt32Value { |
||||
get { return result.ExtraInt32Value; } |
||||
set { SetExtraInt32Value(value); } |
||||
} |
||||
public Builder SetExtraInt32Value(int value) { |
||||
PrepareBuilder(); |
||||
result.hasExtraInt32Value = true; |
||||
result.extraInt32Value_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearExtraInt32Value() { |
||||
PrepareBuilder(); |
||||
result.hasExtraInt32Value = false; |
||||
result.extraInt32Value_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static FooWithExtraFields() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestDropUnknownFields.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,346 +1,347 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestImportProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder> internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestImportProtoFile() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CiVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0LnByb3RvEhhwcm90", |
||||
"b2J1Zl91bml0dGVzdF9pbXBvcnQaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBf", |
||||
"b3B0aW9ucy5wcm90byIaCg1JbXBvcnRNZXNzYWdlEgkKAWQYASABKAUqPAoK", |
||||
"SW1wb3J0RW51bRIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JBUhAIEg4K", |
||||
"CklNUE9SVF9CQVoQCUJbChhjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3RIAcI+", |
||||
"PAohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEhdVbml0VGVz", |
||||
"dEltcG9ydFByb3RvRmlsZQ==")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder>(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, |
||||
new string[] { "D", }); |
||||
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 |
||||
public enum ImportEnum { |
||||
IMPORT_FOO = 7, |
||||
IMPORT_BAR = 8, |
||||
IMPORT_BAZ = 9, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class ImportMessage : pb::GeneratedMessage<ImportMessage, ImportMessage.Builder> { |
||||
private ImportMessage() { } |
||||
private static readonly ImportMessage defaultInstance = new ImportMessage().MakeReadOnly(); |
||||
private static readonly string[] _importMessageFieldNames = new string[] { "d" }; |
||||
private static readonly uint[] _importMessageFieldTags = new uint[] { 8 }; |
||||
public static ImportMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override ImportMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<ImportMessage, ImportMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int DFieldNumber = 1; |
||||
private bool hasD; |
||||
private int d_; |
||||
public bool HasD { |
||||
get { return hasD; } |
||||
} |
||||
public int D { |
||||
get { return d_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _importMessageFieldNames; |
||||
if (hasD) { |
||||
output.WriteInt32(1, field_names[0], D); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasD) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private ImportMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(ImportMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<ImportMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(ImportMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private ImportMessage result; |
||||
|
||||
private ImportMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
ImportMessage original = result; |
||||
result = new ImportMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override ImportMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.Descriptor; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is ImportMessage) { |
||||
return MergeFrom((ImportMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(ImportMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasD) { |
||||
D = other.D; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_importMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _importMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasD = input.ReadInt32(ref result.d_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasD { |
||||
get { return result.hasD; } |
||||
} |
||||
public int D { |
||||
get { return result.D; } |
||||
set { SetD(value); } |
||||
} |
||||
public Builder SetD(int value) { |
||||
PrepareBuilder(); |
||||
result.hasD = true; |
||||
result.d_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearD() { |
||||
PrepareBuilder(); |
||||
result.hasD = false; |
||||
result.d_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static ImportMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_import.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestImport { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder> internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnittestImport() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CiVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0LnByb3RvEhhwcm90", |
||||
"b2J1Zl91bml0dGVzdF9pbXBvcnQaLGdvb2dsZS9wcm90b2J1Zi91bml0dGVz", |
||||
"dF9pbXBvcnRfcHVibGljLnByb3RvIhoKDUltcG9ydE1lc3NhZ2USCQoBZBgB", |
||||
"IAEoBSo8CgpJbXBvcnRFbnVtEg4KCklNUE9SVF9GT08QBxIOCgpJTVBPUlRf", |
||||
"QkFSEAgSDgoKSU1QT1JUX0JBWhAJQkMKGGNvbS5nb29nbGUucHJvdG9idWYu", |
||||
"dGVzdEgB+AEBqgIhR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9z", |
||||
"UAA=")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder>(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, |
||||
new string[] { "D", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.Descriptor, |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Enums |
||||
public enum ImportEnum { |
||||
IMPORT_FOO = 7, |
||||
IMPORT_BAR = 8, |
||||
IMPORT_BAZ = 9, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class ImportMessage : pb::GeneratedMessage<ImportMessage, ImportMessage.Builder> { |
||||
private ImportMessage() { } |
||||
private static readonly ImportMessage defaultInstance = new ImportMessage().MakeReadOnly(); |
||||
private static readonly string[] _importMessageFieldNames = new string[] { "d" }; |
||||
private static readonly uint[] _importMessageFieldTags = new uint[] { 8 }; |
||||
public static ImportMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override ImportMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImport.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<ImportMessage, ImportMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImport.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int DFieldNumber = 1; |
||||
private bool hasD; |
||||
private int d_; |
||||
public bool HasD { |
||||
get { return hasD; } |
||||
} |
||||
public int D { |
||||
get { return d_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _importMessageFieldNames; |
||||
if (hasD) { |
||||
output.WriteInt32(1, field_names[0], D); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasD) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private ImportMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(ImportMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<ImportMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(ImportMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private ImportMessage result; |
||||
|
||||
private ImportMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
ImportMessage original = result; |
||||
result = new ImportMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override ImportMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.Descriptor; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is ImportMessage) { |
||||
return MergeFrom((ImportMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(ImportMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasD) { |
||||
D = other.D; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_importMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _importMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasD = input.ReadInt32(ref result.d_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasD { |
||||
get { return result.hasD; } |
||||
} |
||||
public int D { |
||||
get { return result.D; } |
||||
set { SetD(value); } |
||||
} |
||||
public Builder SetD(int value) { |
||||
PrepareBuilder(); |
||||
result.hasD = true; |
||||
result.d_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearD() { |
||||
PrepareBuilder(); |
||||
result.hasD = false; |
||||
result.d_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static ImportMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestImport.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -0,0 +1,333 @@ |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_import_public.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestImportPublic { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.PublicImportMessage, global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.Builder> internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnittestImportPublic() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"Cixnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpYy5wcm90", |
||||
"bxIYcHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0IiAKE1B1YmxpY0ltcG9ydE1l", |
||||
"c3NhZ2USCQoBZRgBIAEoBUI+Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3Sq", |
||||
"AiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3M=")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.PublicImportMessage, global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.Builder>(internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor, |
||||
new string[] { "E", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class PublicImportMessage : pb::GeneratedMessage<PublicImportMessage, PublicImportMessage.Builder> { |
||||
private PublicImportMessage() { } |
||||
private static readonly PublicImportMessage defaultInstance = new PublicImportMessage().MakeReadOnly(); |
||||
private static readonly string[] _publicImportMessageFieldNames = new string[] { "e" }; |
||||
private static readonly uint[] _publicImportMessageFieldTags = new uint[] { 8 }; |
||||
public static PublicImportMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override PublicImportMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override PublicImportMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<PublicImportMessage, PublicImportMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int EFieldNumber = 1; |
||||
private bool hasE; |
||||
private int e_; |
||||
public bool HasE { |
||||
get { return hasE; } |
||||
} |
||||
public int E { |
||||
get { return e_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _publicImportMessageFieldNames; |
||||
if (hasE) { |
||||
output.WriteInt32(1, field_names[0], E); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasE) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, E); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private PublicImportMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(PublicImportMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<PublicImportMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(PublicImportMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private PublicImportMessage result; |
||||
|
||||
private PublicImportMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
PublicImportMessage original = result; |
||||
result = new PublicImportMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override PublicImportMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.Descriptor; } |
||||
} |
||||
|
||||
public override PublicImportMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override PublicImportMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is PublicImportMessage) { |
||||
return MergeFrom((PublicImportMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(PublicImportMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasE) { |
||||
E = other.E; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_publicImportMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _publicImportMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasE = input.ReadInt32(ref result.e_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasE { |
||||
get { return result.hasE; } |
||||
} |
||||
public int E { |
||||
get { return result.E; } |
||||
set { SetE(value); } |
||||
} |
||||
public Builder SetE(int value) { |
||||
PrepareBuilder(); |
||||
result.hasE = true; |
||||
result.e_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearE() { |
||||
PrepareBuilder(); |
||||
result.hasE = false; |
||||
result.e_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static PublicImportMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,684 @@ |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_preserve_unknown_enum2.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestPreserveUnknownEnum2 { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MyMessage, global::Google.ProtocolBuffers.TestProtos.MyMessage.Builder> internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnittestPreserveUnknownEnum2() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CjVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfcHJlc2VydmVfdW5rbm93bl9l", |
||||
"bnVtMi5wcm90bxIlcHJvdG8yX3ByZXNlcnZlX3Vua25vd25fZW51bV91bml0", |
||||
"dGVzdCK4AwoJTXlNZXNzYWdlEjgKAWUYASABKA4yLS5wcm90bzJfcHJlc2Vy", |
||||
"dmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bRJBCgpyZXBlYXRlZF9l", |
||||
"GAIgAygOMi0ucHJvdG8yX3ByZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVz", |
||||
"dC5NeUVudW0STAoRcmVwZWF0ZWRfcGFja2VkX2UYAyADKA4yLS5wcm90bzJf", |
||||
"cHJlc2VydmVfdW5rbm93bl9lbnVtX3VuaXR0ZXN0Lk15RW51bUICEAESUwoc", |
||||
"cmVwZWF0ZWRfcGFja2VkX3VuZXhwZWN0ZWRfZRgEIAMoDjItLnByb3RvMl9w", |
||||
"cmVzZXJ2ZV91bmtub3duX2VudW1fdW5pdHRlc3QuTXlFbnVtEkIKCW9uZW9m", |
||||
"X2VfMRgFIAEoDjItLnByb3RvMl9wcmVzZXJ2ZV91bmtub3duX2VudW1fdW5p", |
||||
"dHRlc3QuTXlFbnVtSAASQgoJb25lb2ZfZV8yGAYgASgOMi0ucHJvdG8yX3By", |
||||
"ZXNlcnZlX3Vua25vd25fZW51bV91bml0dGVzdC5NeUVudW1IAEIDCgFvKiMK", |
||||
"Bk15RW51bRIHCgNGT08QABIHCgNCQVIQARIHCgNCQVoQAkIkqgIhR29vZ2xl", |
||||
"LlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9z")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.MyMessage, global::Google.ProtocolBuffers.TestProtos.MyMessage.Builder>(internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor, |
||||
new string[] { "E", "RepeatedE", "RepeatedPackedE", "RepeatedPackedUnexpectedE", "OneofE1", "OneofE2", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Enums |
||||
public enum MyEnum { |
||||
FOO = 0, |
||||
BAR = 1, |
||||
BAZ = 2, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class MyMessage : pb::GeneratedMessage<MyMessage, MyMessage.Builder> { |
||||
private MyMessage() { } |
||||
private static readonly MyMessage defaultInstance = new MyMessage().MakeReadOnly(); |
||||
private static readonly string[] _myMessageFieldNames = new string[] { "e", "oneof_e_1", "oneof_e_2", "repeated_e", "repeated_packed_e", "repeated_packed_unexpected_e" }; |
||||
private static readonly uint[] _myMessageFieldTags = new uint[] { 8, 40, 48, 16, 26, 32 }; |
||||
public static MyMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override MyMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override MyMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum2.internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<MyMessage, MyMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum2.internal__static_proto2_preserve_unknown_enum_unittest_MyMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int EFieldNumber = 1; |
||||
private bool hasE; |
||||
private global::Google.ProtocolBuffers.TestProtos.MyEnum e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
||||
public bool HasE { |
||||
get { return hasE; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum E { |
||||
get { return e_; } |
||||
} |
||||
|
||||
public const int RepeatedEFieldNumber = 2; |
||||
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> repeatedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum>(); |
||||
public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedEList { |
||||
get { return pbc::Lists.AsReadOnly(repeatedE_); } |
||||
} |
||||
public int RepeatedECount { |
||||
get { return repeatedE_.Count; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { |
||||
return repeatedE_[index]; |
||||
} |
||||
|
||||
public const int RepeatedPackedEFieldNumber = 3; |
||||
private int repeatedPackedEMemoizedSerializedSize; |
||||
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> repeatedPackedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum>(); |
||||
public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedPackedEList { |
||||
get { return pbc::Lists.AsReadOnly(repeatedPackedE_); } |
||||
} |
||||
public int RepeatedPackedECount { |
||||
get { return repeatedPackedE_.Count; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { |
||||
return repeatedPackedE_[index]; |
||||
} |
||||
|
||||
public const int RepeatedPackedUnexpectedEFieldNumber = 4; |
||||
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> repeatedPackedUnexpectedE_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum>(); |
||||
public scg::IList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedPackedUnexpectedEList { |
||||
get { return pbc::Lists.AsReadOnly(repeatedPackedUnexpectedE_); } |
||||
} |
||||
public int RepeatedPackedUnexpectedECount { |
||||
get { return repeatedPackedUnexpectedE_.Count; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedUnexpectedE(int index) { |
||||
return repeatedPackedUnexpectedE_[index]; |
||||
} |
||||
|
||||
public const int OneofE1FieldNumber = 5; |
||||
private bool hasOneofE1; |
||||
private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
||||
public bool HasOneofE1 { |
||||
get { return hasOneofE1; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { |
||||
get { return oneofE1_; } |
||||
} |
||||
|
||||
public const int OneofE2FieldNumber = 6; |
||||
private bool hasOneofE2; |
||||
private global::Google.ProtocolBuffers.TestProtos.MyEnum oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
||||
public bool HasOneofE2 { |
||||
get { return hasOneofE2; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { |
||||
get { return oneofE2_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _myMessageFieldNames; |
||||
if (hasE) { |
||||
output.WriteEnum(1, field_names[0], (int) E, E); |
||||
} |
||||
if (repeatedE_.Count > 0) { |
||||
output.WriteEnumArray(2, field_names[3], repeatedE_); |
||||
} |
||||
if (repeatedPackedE_.Count > 0) { |
||||
output.WritePackedEnumArray(3, field_names[4], repeatedPackedEMemoizedSerializedSize, repeatedPackedE_); |
||||
} |
||||
if (repeatedPackedUnexpectedE_.Count > 0) { |
||||
output.WriteEnumArray(4, field_names[5], repeatedPackedUnexpectedE_); |
||||
} |
||||
if (hasOneofE1) { |
||||
output.WriteEnum(5, field_names[1], (int) OneofE1, OneofE1); |
||||
} |
||||
if (hasOneofE2) { |
||||
output.WriteEnum(6, field_names[2], (int) OneofE2, OneofE2); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasE) { |
||||
size += pb::CodedOutputStream.ComputeEnumSize(1, (int) E); |
||||
} |
||||
{ |
||||
int dataSize = 0; |
||||
if (repeatedE_.Count > 0) { |
||||
foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedE_) { |
||||
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
||||
} |
||||
size += dataSize; |
||||
size += 1 * repeatedE_.Count; |
||||
} |
||||
} |
||||
{ |
||||
int dataSize = 0; |
||||
if (repeatedPackedE_.Count > 0) { |
||||
foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedPackedE_) { |
||||
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
||||
} |
||||
size += dataSize; |
||||
size += 1; |
||||
size += pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize); |
||||
} |
||||
repeatedPackedEMemoizedSerializedSize = dataSize; |
||||
} |
||||
{ |
||||
int dataSize = 0; |
||||
if (repeatedPackedUnexpectedE_.Count > 0) { |
||||
foreach (global::Google.ProtocolBuffers.TestProtos.MyEnum element in repeatedPackedUnexpectedE_) { |
||||
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
||||
} |
||||
size += dataSize; |
||||
size += 1 * repeatedPackedUnexpectedE_.Count; |
||||
} |
||||
} |
||||
if (hasOneofE1) { |
||||
size += pb::CodedOutputStream.ComputeEnumSize(5, (int) OneofE1); |
||||
} |
||||
if (hasOneofE2) { |
||||
size += pb::CodedOutputStream.ComputeEnumSize(6, (int) OneofE2); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static MyMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static MyMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private MyMessage MakeReadOnly() { |
||||
repeatedE_.MakeReadOnly(); |
||||
repeatedPackedE_.MakeReadOnly(); |
||||
repeatedPackedUnexpectedE_.MakeReadOnly(); |
||||
return this; |
||||
} |
||||
|
||||
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(MyMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<MyMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(MyMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private MyMessage result; |
||||
|
||||
private MyMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
MyMessage original = result; |
||||
result = new MyMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override MyMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.Descriptor; } |
||||
} |
||||
|
||||
public override MyMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override MyMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is MyMessage) { |
||||
return MergeFrom((MyMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(MyMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.MyMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasE) { |
||||
E = other.E; |
||||
} |
||||
if (other.repeatedE_.Count != 0) { |
||||
result.repeatedE_.Add(other.repeatedE_); |
||||
} |
||||
if (other.repeatedPackedE_.Count != 0) { |
||||
result.repeatedPackedE_.Add(other.repeatedPackedE_); |
||||
} |
||||
if (other.repeatedPackedUnexpectedE_.Count != 0) { |
||||
result.repeatedPackedUnexpectedE_.Add(other.repeatedPackedUnexpectedE_); |
||||
} |
||||
if (other.HasOneofE1) { |
||||
OneofE1 = other.OneofE1; |
||||
} |
||||
if (other.HasOneofE2) { |
||||
OneofE2 = other.OneofE2; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_myMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _myMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
object unknown; |
||||
if(input.ReadEnum(ref result.e_, out unknown)) { |
||||
result.hasE = true; |
||||
} else if(unknown is int) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
unknownFields.MergeVarintField(1, (ulong)(int)unknown); |
||||
} |
||||
break; |
||||
} |
||||
case 18: |
||||
case 16: { |
||||
scg::ICollection<object> unknownItems; |
||||
input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnum>(tag, field_name, result.repeatedE_, out unknownItems); |
||||
if (unknownItems != null) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
foreach (object rawValue in unknownItems) |
||||
if (rawValue is int) |
||||
unknownFields.MergeVarintField(2, (ulong)(int)rawValue); |
||||
} |
||||
break; |
||||
} |
||||
case 26: |
||||
case 24: { |
||||
scg::ICollection<object> unknownItems; |
||||
input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnum>(tag, field_name, result.repeatedPackedE_, out unknownItems); |
||||
if (unknownItems != null) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
foreach (object rawValue in unknownItems) |
||||
if (rawValue is int) |
||||
unknownFields.MergeVarintField(3, (ulong)(int)rawValue); |
||||
} |
||||
break; |
||||
} |
||||
case 34: |
||||
case 32: { |
||||
scg::ICollection<object> unknownItems; |
||||
input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.MyEnum>(tag, field_name, result.repeatedPackedUnexpectedE_, out unknownItems); |
||||
if (unknownItems != null) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
foreach (object rawValue in unknownItems) |
||||
if (rawValue is int) |
||||
unknownFields.MergeVarintField(4, (ulong)(int)rawValue); |
||||
} |
||||
break; |
||||
} |
||||
case 40: { |
||||
object unknown; |
||||
if(input.ReadEnum(ref result.oneofE1_, out unknown)) { |
||||
result.hasOneofE1 = true; |
||||
} else if(unknown is int) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
unknownFields.MergeVarintField(5, (ulong)(int)unknown); |
||||
} |
||||
break; |
||||
} |
||||
case 48: { |
||||
object unknown; |
||||
if(input.ReadEnum(ref result.oneofE2_, out unknown)) { |
||||
result.hasOneofE2 = true; |
||||
} else if(unknown is int) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
unknownFields.MergeVarintField(6, (ulong)(int)unknown); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasE { |
||||
get { return result.hasE; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum E { |
||||
get { return result.E; } |
||||
set { SetE(value); } |
||||
} |
||||
public Builder SetE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.hasE = true; |
||||
result.e_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearE() { |
||||
PrepareBuilder(); |
||||
result.hasE = false; |
||||
result.e_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
||||
return this; |
||||
} |
||||
|
||||
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedEList { |
||||
get { return PrepareBuilder().repeatedE_; } |
||||
} |
||||
public int RepeatedECount { |
||||
get { return result.RepeatedECount; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedE(int index) { |
||||
return result.GetRepeatedE(index); |
||||
} |
||||
public Builder SetRepeatedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.repeatedE_[index] = value; |
||||
return this; |
||||
} |
||||
public Builder AddRepeatedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.repeatedE_.Add(value); |
||||
return this; |
||||
} |
||||
public Builder AddRangeRepeatedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnum> values) { |
||||
PrepareBuilder(); |
||||
result.repeatedE_.Add(values); |
||||
return this; |
||||
} |
||||
public Builder ClearRepeatedE() { |
||||
PrepareBuilder(); |
||||
result.repeatedE_.Clear(); |
||||
return this; |
||||
} |
||||
|
||||
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedPackedEList { |
||||
get { return PrepareBuilder().repeatedPackedE_; } |
||||
} |
||||
public int RepeatedPackedECount { |
||||
get { return result.RepeatedPackedECount; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedE(int index) { |
||||
return result.GetRepeatedPackedE(index); |
||||
} |
||||
public Builder SetRepeatedPackedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedE_[index] = value; |
||||
return this; |
||||
} |
||||
public Builder AddRepeatedPackedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedE_.Add(value); |
||||
return this; |
||||
} |
||||
public Builder AddRangeRepeatedPackedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnum> values) { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedE_.Add(values); |
||||
return this; |
||||
} |
||||
public Builder ClearRepeatedPackedE() { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedE_.Clear(); |
||||
return this; |
||||
} |
||||
|
||||
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.MyEnum> RepeatedPackedUnexpectedEList { |
||||
get { return PrepareBuilder().repeatedPackedUnexpectedE_; } |
||||
} |
||||
public int RepeatedPackedUnexpectedECount { |
||||
get { return result.RepeatedPackedUnexpectedECount; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum GetRepeatedPackedUnexpectedE(int index) { |
||||
return result.GetRepeatedPackedUnexpectedE(index); |
||||
} |
||||
public Builder SetRepeatedPackedUnexpectedE(int index, global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedUnexpectedE_[index] = value; |
||||
return this; |
||||
} |
||||
public Builder AddRepeatedPackedUnexpectedE(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedUnexpectedE_.Add(value); |
||||
return this; |
||||
} |
||||
public Builder AddRangeRepeatedPackedUnexpectedE(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.MyEnum> values) { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedUnexpectedE_.Add(values); |
||||
return this; |
||||
} |
||||
public Builder ClearRepeatedPackedUnexpectedE() { |
||||
PrepareBuilder(); |
||||
result.repeatedPackedUnexpectedE_.Clear(); |
||||
return this; |
||||
} |
||||
|
||||
public bool HasOneofE1 { |
||||
get { return result.hasOneofE1; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE1 { |
||||
get { return result.OneofE1; } |
||||
set { SetOneofE1(value); } |
||||
} |
||||
public Builder SetOneofE1(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.hasOneofE1 = true; |
||||
result.oneofE1_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearOneofE1() { |
||||
PrepareBuilder(); |
||||
result.hasOneofE1 = false; |
||||
result.oneofE1_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
||||
return this; |
||||
} |
||||
|
||||
public bool HasOneofE2 { |
||||
get { return result.hasOneofE2; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.MyEnum OneofE2 { |
||||
get { return result.OneofE2; } |
||||
set { SetOneofE2(value); } |
||||
} |
||||
public Builder SetOneofE2(global::Google.ProtocolBuffers.TestProtos.MyEnum value) { |
||||
PrepareBuilder(); |
||||
result.hasOneofE2 = true; |
||||
result.oneofE2_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearOneofE2() { |
||||
PrepareBuilder(); |
||||
result.hasOneofE2 = false; |
||||
result.oneofE2_ = global::Google.ProtocolBuffers.TestProtos.MyEnum.FOO; |
||||
return this; |
||||
} |
||||
} |
||||
static MyMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestPreserveUnknownEnum2.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -0,0 +1,809 @@ |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unknown_enum_test.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnknownEnumTest { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_google_protobuf_util_DownRevision__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.DownRevision, global::Google.ProtocolBuffers.TestProtos.DownRevision.Builder> internal__static_google_protobuf_util_DownRevision__FieldAccessorTable; |
||||
internal static pbd::MessageDescriptor internal__static_google_protobuf_util_UpRevision__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.UpRevision, global::Google.ProtocolBuffers.TestProtos.UpRevision.Builder> internal__static_google_protobuf_util_UpRevision__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnknownEnumTest() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"Cidnb29nbGUvcHJvdG9idWYvdW5rbm93bl9lbnVtX3Rlc3QucHJvdG8SFGdv", |
||||
"b2dsZS5wcm90b2J1Zi51dGlsIr8BCgxEb3duUmV2aXNpb24SRQoFdmFsdWUY", |
||||
"ASABKA4yJy5nb29nbGUucHJvdG9idWYudXRpbC5Eb3duUmV2aXNpb24uRW51", |
||||
"bToNREVGQVVMVF9WQUxVRRI3CgZ2YWx1ZXMYAiADKA4yJy5nb29nbGUucHJv", |
||||
"dG9idWYudXRpbC5Eb3duUmV2aXNpb24uRW51bSIvCgRFbnVtEhEKDURFRkFV", |
||||
"TFRfVkFMVUUQAhIUChBOT05ERUZBVUxUX1ZBTFVFEAMi6gEKClVwUmV2aXNp", |
||||
"b24SQwoFdmFsdWUYASABKA4yJS5nb29nbGUucHJvdG9idWYudXRpbC5VcFJl", |
||||
"dmlzaW9uLkVudW06DURFRkFVTFRfVkFMVUUSNQoGdmFsdWVzGAIgAygOMiUu", |
||||
"Z29vZ2xlLnByb3RvYnVmLnV0aWwuVXBSZXZpc2lvbi5FbnVtImAKBEVudW0S", |
||||
"EQoNREVGQVVMVF9WQUxVRRACEhQKEE5PTkRFRkFVTFRfVkFMVUUQAxINCglO", |
||||
"RVdfVkFMVUUQBBIPCgtORVdfVkFMVUVfMhAFEg8KC05FV19WQUxVRV8zEAZC", |
||||
"JKoCIUdvb2dsZS5Qcm90b2NvbEJ1ZmZlcnMuVGVzdFByb3Rvcw==")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_google_protobuf_util_DownRevision__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_google_protobuf_util_DownRevision__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.DownRevision, global::Google.ProtocolBuffers.TestProtos.DownRevision.Builder>(internal__static_google_protobuf_util_DownRevision__Descriptor, |
||||
new string[] { "Value", "Values", }); |
||||
internal__static_google_protobuf_util_UpRevision__Descriptor = Descriptor.MessageTypes[1]; |
||||
internal__static_google_protobuf_util_UpRevision__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.UpRevision, global::Google.ProtocolBuffers.TestProtos.UpRevision.Builder>(internal__static_google_protobuf_util_UpRevision__Descriptor, |
||||
new string[] { "Value", "Values", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class DownRevision : pb::GeneratedMessage<DownRevision, DownRevision.Builder> { |
||||
private DownRevision() { } |
||||
private static readonly DownRevision defaultInstance = new DownRevision().MakeReadOnly(); |
||||
private static readonly string[] _downRevisionFieldNames = new string[] { "value", "values" }; |
||||
private static readonly uint[] _downRevisionFieldTags = new uint[] { 8, 16 }; |
||||
public static DownRevision DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override DownRevision DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override DownRevision ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnknownEnumTest.internal__static_google_protobuf_util_DownRevision__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<DownRevision, DownRevision.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnknownEnumTest.internal__static_google_protobuf_util_DownRevision__FieldAccessorTable; } |
||||
} |
||||
|
||||
#region Nested types |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public static partial class Types { |
||||
public enum Enum { |
||||
DEFAULT_VALUE = 2, |
||||
NONDEFAULT_VALUE = 3, |
||||
} |
||||
|
||||
} |
||||
#endregion |
||||
|
||||
public const int ValueFieldNumber = 1; |
||||
private bool hasValue; |
||||
private global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum value_ = global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum.DEFAULT_VALUE; |
||||
public bool HasValue { |
||||
get { return hasValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum Value { |
||||
get { return value_; } |
||||
} |
||||
|
||||
public const int ValuesFieldNumber = 2; |
||||
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum> values_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum>(); |
||||
public scg::IList<global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum> ValuesList { |
||||
get { return pbc::Lists.AsReadOnly(values_); } |
||||
} |
||||
public int ValuesCount { |
||||
get { return values_.Count; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum GetValues(int index) { |
||||
return values_[index]; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _downRevisionFieldNames; |
||||
if (hasValue) { |
||||
output.WriteEnum(1, field_names[0], (int) Value, Value); |
||||
} |
||||
if (values_.Count > 0) { |
||||
output.WriteEnumArray(2, field_names[1], values_); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasValue) { |
||||
size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Value); |
||||
} |
||||
{ |
||||
int dataSize = 0; |
||||
if (values_.Count > 0) { |
||||
foreach (global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum element in values_) { |
||||
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
||||
} |
||||
size += dataSize; |
||||
size += 1 * values_.Count; |
||||
} |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static DownRevision ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static DownRevision ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private DownRevision MakeReadOnly() { |
||||
values_.MakeReadOnly(); |
||||
return this; |
||||
} |
||||
|
||||
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(DownRevision prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<DownRevision, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(DownRevision cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private DownRevision result; |
||||
|
||||
private DownRevision PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
DownRevision original = result; |
||||
result = new DownRevision(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override DownRevision MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.DownRevision.Descriptor; } |
||||
} |
||||
|
||||
public override DownRevision DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.DownRevision.DefaultInstance; } |
||||
} |
||||
|
||||
public override DownRevision BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is DownRevision) { |
||||
return MergeFrom((DownRevision) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(DownRevision other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.DownRevision.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasValue) { |
||||
Value = other.Value; |
||||
} |
||||
if (other.values_.Count != 0) { |
||||
result.values_.Add(other.values_); |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_downRevisionFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _downRevisionFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
object unknown; |
||||
if(input.ReadEnum(ref result.value_, out unknown)) { |
||||
result.hasValue = true; |
||||
} else if(unknown is int) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
unknownFields.MergeVarintField(1, (ulong)(int)unknown); |
||||
} |
||||
break; |
||||
} |
||||
case 18: |
||||
case 16: { |
||||
scg::ICollection<object> unknownItems; |
||||
input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum>(tag, field_name, result.values_, out unknownItems); |
||||
if (unknownItems != null) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
foreach (object rawValue in unknownItems) |
||||
if (rawValue is int) |
||||
unknownFields.MergeVarintField(2, (ulong)(int)rawValue); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasValue { |
||||
get { return result.hasValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum Value { |
||||
get { return result.Value; } |
||||
set { SetValue(value); } |
||||
} |
||||
public Builder SetValue(global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum value) { |
||||
PrepareBuilder(); |
||||
result.hasValue = true; |
||||
result.value_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearValue() { |
||||
PrepareBuilder(); |
||||
result.hasValue = false; |
||||
result.value_ = global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum.DEFAULT_VALUE; |
||||
return this; |
||||
} |
||||
|
||||
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum> ValuesList { |
||||
get { return PrepareBuilder().values_; } |
||||
} |
||||
public int ValuesCount { |
||||
get { return result.ValuesCount; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum GetValues(int index) { |
||||
return result.GetValues(index); |
||||
} |
||||
public Builder SetValues(int index, global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum value) { |
||||
PrepareBuilder(); |
||||
result.values_[index] = value; |
||||
return this; |
||||
} |
||||
public Builder AddValues(global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum value) { |
||||
PrepareBuilder(); |
||||
result.values_.Add(value); |
||||
return this; |
||||
} |
||||
public Builder AddRangeValues(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.DownRevision.Types.Enum> values) { |
||||
PrepareBuilder(); |
||||
result.values_.Add(values); |
||||
return this; |
||||
} |
||||
public Builder ClearValues() { |
||||
PrepareBuilder(); |
||||
result.values_.Clear(); |
||||
return this; |
||||
} |
||||
} |
||||
static DownRevision() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnknownEnumTest.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class UpRevision : pb::GeneratedMessage<UpRevision, UpRevision.Builder> { |
||||
private UpRevision() { } |
||||
private static readonly UpRevision defaultInstance = new UpRevision().MakeReadOnly(); |
||||
private static readonly string[] _upRevisionFieldNames = new string[] { "value", "values" }; |
||||
private static readonly uint[] _upRevisionFieldTags = new uint[] { 8, 16 }; |
||||
public static UpRevision DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override UpRevision DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override UpRevision ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnknownEnumTest.internal__static_google_protobuf_util_UpRevision__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<UpRevision, UpRevision.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnknownEnumTest.internal__static_google_protobuf_util_UpRevision__FieldAccessorTable; } |
||||
} |
||||
|
||||
#region Nested types |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public static partial class Types { |
||||
public enum Enum { |
||||
DEFAULT_VALUE = 2, |
||||
NONDEFAULT_VALUE = 3, |
||||
NEW_VALUE = 4, |
||||
NEW_VALUE_2 = 5, |
||||
NEW_VALUE_3 = 6, |
||||
} |
||||
|
||||
} |
||||
#endregion |
||||
|
||||
public const int ValueFieldNumber = 1; |
||||
private bool hasValue; |
||||
private global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum value_ = global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum.DEFAULT_VALUE; |
||||
public bool HasValue { |
||||
get { return hasValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum Value { |
||||
get { return value_; } |
||||
} |
||||
|
||||
public const int ValuesFieldNumber = 2; |
||||
private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum> values_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum>(); |
||||
public scg::IList<global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum> ValuesList { |
||||
get { return pbc::Lists.AsReadOnly(values_); } |
||||
} |
||||
public int ValuesCount { |
||||
get { return values_.Count; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum GetValues(int index) { |
||||
return values_[index]; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _upRevisionFieldNames; |
||||
if (hasValue) { |
||||
output.WriteEnum(1, field_names[0], (int) Value, Value); |
||||
} |
||||
if (values_.Count > 0) { |
||||
output.WriteEnumArray(2, field_names[1], values_); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasValue) { |
||||
size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Value); |
||||
} |
||||
{ |
||||
int dataSize = 0; |
||||
if (values_.Count > 0) { |
||||
foreach (global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum element in values_) { |
||||
dataSize += pb::CodedOutputStream.ComputeEnumSizeNoTag((int) element); |
||||
} |
||||
size += dataSize; |
||||
size += 1 * values_.Count; |
||||
} |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static UpRevision ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static UpRevision ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private UpRevision MakeReadOnly() { |
||||
values_.MakeReadOnly(); |
||||
return this; |
||||
} |
||||
|
||||
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(UpRevision prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<UpRevision, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(UpRevision cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private UpRevision result; |
||||
|
||||
private UpRevision PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
UpRevision original = result; |
||||
result = new UpRevision(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override UpRevision MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UpRevision.Descriptor; } |
||||
} |
||||
|
||||
public override UpRevision DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UpRevision.DefaultInstance; } |
||||
} |
||||
|
||||
public override UpRevision BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is UpRevision) { |
||||
return MergeFrom((UpRevision) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(UpRevision other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.UpRevision.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasValue) { |
||||
Value = other.Value; |
||||
} |
||||
if (other.values_.Count != 0) { |
||||
result.values_.Add(other.values_); |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_upRevisionFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _upRevisionFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
object unknown; |
||||
if(input.ReadEnum(ref result.value_, out unknown)) { |
||||
result.hasValue = true; |
||||
} else if(unknown is int) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
unknownFields.MergeVarintField(1, (ulong)(int)unknown); |
||||
} |
||||
break; |
||||
} |
||||
case 18: |
||||
case 16: { |
||||
scg::ICollection<object> unknownItems; |
||||
input.ReadEnumArray<global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum>(tag, field_name, result.values_, out unknownItems); |
||||
if (unknownItems != null) { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
foreach (object rawValue in unknownItems) |
||||
if (rawValue is int) |
||||
unknownFields.MergeVarintField(2, (ulong)(int)rawValue); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasValue { |
||||
get { return result.hasValue; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum Value { |
||||
get { return result.Value; } |
||||
set { SetValue(value); } |
||||
} |
||||
public Builder SetValue(global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum value) { |
||||
PrepareBuilder(); |
||||
result.hasValue = true; |
||||
result.value_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearValue() { |
||||
PrepareBuilder(); |
||||
result.hasValue = false; |
||||
result.value_ = global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum.DEFAULT_VALUE; |
||||
return this; |
||||
} |
||||
|
||||
public pbc::IPopsicleList<global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum> ValuesList { |
||||
get { return PrepareBuilder().values_; } |
||||
} |
||||
public int ValuesCount { |
||||
get { return result.ValuesCount; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum GetValues(int index) { |
||||
return result.GetValues(index); |
||||
} |
||||
public Builder SetValues(int index, global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum value) { |
||||
PrepareBuilder(); |
||||
result.values_[index] = value; |
||||
return this; |
||||
} |
||||
public Builder AddValues(global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum value) { |
||||
PrepareBuilder(); |
||||
result.values_.Add(value); |
||||
return this; |
||||
} |
||||
public Builder AddRangeValues(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.UpRevision.Types.Enum> values) { |
||||
PrepareBuilder(); |
||||
result.values_.Add(values); |
||||
return this; |
||||
} |
||||
public Builder ClearValues() { |
||||
PrepareBuilder(); |
||||
result.values_.Clear(); |
||||
return this; |
||||
} |
||||
} |
||||
static UpRevision() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnknownEnumTest.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,386 +0,0 @@ |
||||
#region Copyright notice and license |
||||
|
||||
// Protocol Buffers - Google's data interchange format |
||||
// Copyright 2008 Google Inc. All rights reserved. |
||||
// http://github.com/jskeet/dotnet-protobufs/ |
||||
// Original C++/Java/Python code: |
||||
// http://code.google.com/p/protobuf/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
#endregion |
||||
|
||||
using System; |
||||
using Google.ProtocolBuffers; |
||||
using Google.ProtocolBuffers.Serialization.Http; |
||||
using Google.ProtocolBuffers.TestProtos; |
||||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
||||
using System.IO; |
||||
using Google.ProtocolBuffers.Serialization; |
||||
using System.Text; |
||||
|
||||
namespace Google.ProtocolBuffers |
||||
{ |
||||
/// <summary> |
||||
/// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration |
||||
/// of using the new IRpcDispatch to write a client/server |
||||
/// </summary> |
||||
[TestClass] |
||||
public class TestRpcForMimeTypes |
||||
{ |
||||
/// <summary> |
||||
/// A sample implementation of the ISearchService for testing |
||||
/// </summary> |
||||
private class ExampleSearchImpl : ISearchService |
||||
{ |
||||
SearchResponse ISearchService.Search(SearchRequest searchRequest) |
||||
{ |
||||
if (searchRequest.CriteriaCount == 0) |
||||
{ |
||||
throw new ArgumentException("No criteria specified.", new InvalidOperationException()); |
||||
} |
||||
SearchResponse.Builder resp = SearchResponse.CreateBuilder(); |
||||
foreach (string criteria in searchRequest.CriteriaList) |
||||
{ |
||||
resp.AddResults( |
||||
SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://search.com"). |
||||
Build()); |
||||
} |
||||
return resp.Build(); |
||||
} |
||||
|
||||
SearchResponse ISearchService.RefineSearch(RefineSearchRequest refineSearchRequest) |
||||
{ |
||||
SearchResponse.Builder resp = refineSearchRequest.PreviousResults.ToBuilder(); |
||||
foreach (string criteria in refineSearchRequest.CriteriaList) |
||||
{ |
||||
resp.AddResults( |
||||
SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://refine.com"). |
||||
Build()); |
||||
} |
||||
return resp.Build(); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// An example extraction of the wire protocol |
||||
/// </summary> |
||||
private interface IHttpTransfer |
||||
{ |
||||
void Execute(string method, string contentType, Stream input, string acceptType, Stream output); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// An example of a server responding to a web/http request |
||||
/// </summary> |
||||
private class ExampleHttpServer : IHttpTransfer |
||||
{ |
||||
public readonly MessageFormatOptions Options = |
||||
new MessageFormatOptions |
||||
{ |
||||
ExtensionRegistry = ExtensionRegistry.Empty, |
||||
FormattedOutput = true, |
||||
XmlReaderOptions = XmlReaderOptions.ReadNestedArrays, |
||||
XmlReaderRootElementName = "request", |
||||
XmlWriterOptions = XmlWriterOptions.OutputNestedArrays, |
||||
XmlWriterRootElementName = "response" |
||||
}; |
||||
|
||||
private readonly IRpcServerStub _stub; |
||||
|
||||
public ExampleHttpServer(ISearchService implementation) |
||||
{ |
||||
//on the server, we create a dispatch to call the appropriate method by name |
||||
IRpcDispatch dispatch = new SearchService.Dispatch(implementation); |
||||
//we then wrap that dispatch in a server stub which will deserialize the wire bytes to the message |
||||
//type appropriate for the method name being invoked. |
||||
_stub = new SearchService.ServerStub(dispatch); |
||||
} |
||||
|
||||
void IHttpTransfer.Execute(string method, string contentType, Stream input, string acceptType, Stream output) |
||||
{ |
||||
//3.5: _stub.HttpCallMethod( |
||||
Extensions.HttpCallMethod(_stub, |
||||
method, Options, |
||||
contentType, input, |
||||
acceptType, output |
||||
); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// An example of a client sending a wire request |
||||
/// </summary> |
||||
private class ExampleClient : IRpcDispatch |
||||
{ |
||||
public readonly MessageFormatOptions Options = |
||||
new MessageFormatOptions |
||||
{ |
||||
ExtensionRegistry = ExtensionRegistry.Empty, |
||||
FormattedOutput = true, |
||||
XmlReaderOptions = XmlReaderOptions.ReadNestedArrays, |
||||
XmlReaderRootElementName = "response", |
||||
XmlWriterOptions = XmlWriterOptions.OutputNestedArrays, |
||||
XmlWriterRootElementName = "request" |
||||
}; |
||||
|
||||
|
||||
private readonly IHttpTransfer _wire; |
||||
private readonly string _mimeType; |
||||
|
||||
public ExampleClient(IHttpTransfer wire, string mimeType) |
||||
{ |
||||
_wire = wire; |
||||
_mimeType = mimeType; |
||||
} |
||||
|
||||
TMessage IRpcDispatch.CallMethod<TMessage, TBuilder>(string method, IMessageLite request, |
||||
IBuilderLite<TMessage, TBuilder> response) |
||||
{ |
||||
MemoryStream input = new MemoryStream(); |
||||
MemoryStream output = new MemoryStream(); |
||||
|
||||
//Write to _mimeType format |
||||
Extensions.WriteTo(request, Options, _mimeType, input); |
||||
|
||||
input.Position = 0; |
||||
_wire.Execute(method, _mimeType, input, _mimeType, output); |
||||
|
||||
//Read from _mimeType format |
||||
output.Position = 0; |
||||
Extensions.MergeFrom(response, Options, _mimeType, output); |
||||
|
||||
return response.Build(); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Test sending and recieving messages via text/json |
||||
/// </summary> |
||||
[TestMethod] |
||||
public void TestClientServerWithJsonFormat() |
||||
{ |
||||
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); |
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IHttpTransfer wire = server; |
||||
|
||||
ISearchService client = new SearchService(new ExampleClient(wire, "text/json")); |
||||
//now the client has a real, typed, interface to work with: |
||||
SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); |
||||
Assert.AreEqual(1, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
//The test part of this, call the only other method |
||||
result = |
||||
client.RefineSearch( |
||||
RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); |
||||
Assert.AreEqual(2, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
Assert.AreEqual("Refine", result.ResultsList[1].Name); |
||||
Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Test sending and recieving messages via text/json |
||||
/// </summary> |
||||
[TestMethod] |
||||
public void TestClientServerWithXmlFormat() |
||||
{ |
||||
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); |
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IHttpTransfer wire = server; |
||||
|
||||
ISearchService client = new SearchService(new ExampleClient(wire, "text/xml")); |
||||
//now the client has a real, typed, interface to work with: |
||||
SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); |
||||
Assert.AreEqual(1, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
//The test part of this, call the only other method |
||||
result = |
||||
client.RefineSearch( |
||||
RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); |
||||
Assert.AreEqual(2, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
Assert.AreEqual("Refine", result.ResultsList[1].Name); |
||||
Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Test sending and recieving messages via text/json |
||||
/// </summary> |
||||
[TestMethod] |
||||
public void TestClientServerWithProtoFormat() |
||||
{ |
||||
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); |
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IHttpTransfer wire = server; |
||||
|
||||
ISearchService client = new SearchService(new ExampleClient(wire, "application/x-protobuf")); |
||||
//now the client has a real, typed, interface to work with: |
||||
SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); |
||||
Assert.AreEqual(1, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
//The test part of this, call the only other method |
||||
result = |
||||
client.RefineSearch( |
||||
RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); |
||||
Assert.AreEqual(2, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
Assert.AreEqual("Refine", result.ResultsList[1].Name); |
||||
Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Test sending and recieving messages via text/json |
||||
/// </summary> |
||||
[TestMethod] |
||||
public void TestClientServerWithCustomFormat() |
||||
{ |
||||
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); |
||||
//Setup our custom mime-type format as the only format supported: |
||||
server.Options.MimeInputTypes.Clear(); |
||||
server.Options.MimeInputTypes.Add("foo/bar", CodedInputStream.CreateInstance); |
||||
server.Options.MimeOutputTypes.Clear(); |
||||
server.Options.MimeOutputTypes.Add("foo/bar", CodedOutputStream.CreateInstance); |
||||
|
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IHttpTransfer wire = server; |
||||
|
||||
ExampleClient exclient = new ExampleClient(wire, "foo/bar"); |
||||
//Add our custom mime-type format |
||||
exclient.Options.MimeInputTypes.Add("foo/bar", CodedInputStream.CreateInstance); |
||||
exclient.Options.MimeOutputTypes.Add("foo/bar", CodedOutputStream.CreateInstance); |
||||
ISearchService client = new SearchService(exclient); |
||||
|
||||
//now the client has a real, typed, interface to work with: |
||||
SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); |
||||
Assert.AreEqual(1, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
//The test part of this, call the only other method |
||||
result = |
||||
client.RefineSearch( |
||||
RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); |
||||
Assert.AreEqual(2, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
Assert.AreEqual("Refine", result.ResultsList[1].Name); |
||||
Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Test sending and recieving messages via text/json |
||||
/// </summary> |
||||
[TestMethod] |
||||
public void TestServerWithUriFormat() |
||||
{ |
||||
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); |
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IHttpTransfer wire = server; |
||||
|
||||
MemoryStream input = new MemoryStream(Encoding.UTF8.GetBytes("?Criteria=Test&Criteria=Test+of%20URI")); |
||||
MemoryStream output = new MemoryStream(); |
||||
|
||||
//Call the server |
||||
wire.Execute("Search", |
||||
MessageFormatOptions.ContentFormUrlEncoded, input, |
||||
MessageFormatOptions.ContentTypeProtoBuffer, output |
||||
); |
||||
|
||||
SearchResponse result = SearchResponse.ParseFrom(output.ToArray()); |
||||
Assert.AreEqual(2, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
Assert.AreEqual("Test of URI", result.ResultsList[1].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[1].Url); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Test sending and recieving messages via text/json |
||||
/// </summary> |
||||
[TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))] |
||||
public void TestInvalidMimeType() |
||||
{ |
||||
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); |
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IHttpTransfer wire = server; |
||||
|
||||
MemoryStream input = new MemoryStream(); |
||||
MemoryStream output = new MemoryStream(); |
||||
|
||||
//Call the server |
||||
wire.Execute("Search", |
||||
"bad/mime", input, |
||||
MessageFormatOptions.ContentTypeProtoBuffer, output |
||||
); |
||||
Assert.Fail(); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Test sending and recieving messages via text/json |
||||
/// </summary> |
||||
[TestMethod] |
||||
public void TestDefaultMimeType() |
||||
{ |
||||
ExampleHttpServer server = new ExampleHttpServer(new ExampleSearchImpl()); |
||||
|
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IHttpTransfer wire = server; |
||||
|
||||
|
||||
MemoryStream input = new MemoryStream(new SearchRequest.Builder().AddCriteria("Test").Build().ToByteArray()); |
||||
MemoryStream output = new MemoryStream(); |
||||
|
||||
//With this default set, any invalid/unknown mime-type will be mapped to use that format |
||||
server.Options.DefaultContentType = MessageFormatOptions.ContentTypeProtoBuffer; |
||||
|
||||
wire.Execute("Search", |
||||
"foo", input, |
||||
"bar", output |
||||
); |
||||
|
||||
SearchResponse result = SearchResponse.ParseFrom(output.ToArray()); |
||||
Assert.AreEqual(1, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
} |
||||
} |
||||
} |
@ -1,171 +0,0 @@ |
||||
#region Copyright notice and license |
||||
|
||||
// Protocol Buffers - Google's data interchange format |
||||
// Copyright 2008 Google Inc. All rights reserved. |
||||
// http://github.com/jskeet/dotnet-protobufs/ |
||||
// Original C++/Java/Python code: |
||||
// http://code.google.com/p/protobuf/ |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
#endregion |
||||
|
||||
using System; |
||||
using Google.ProtocolBuffers; |
||||
using Google.ProtocolBuffers.TestProtos; |
||||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
||||
|
||||
namespace Google.ProtocolBuffers |
||||
{ |
||||
/// <summary> |
||||
/// This class verifies the correct code is generated from unittest_rpc_interop.proto and provides a small demonstration |
||||
/// of using the new IRpcDispatch to write a client/server |
||||
/// </summary> |
||||
[TestClass] |
||||
public class TestRpcGenerator |
||||
{ |
||||
/// <summary> |
||||
/// A sample implementation of the ISearchService for testing |
||||
/// </summary> |
||||
private class ExampleSearchImpl : ISearchService |
||||
{ |
||||
SearchResponse ISearchService.Search(SearchRequest searchRequest) |
||||
{ |
||||
if (searchRequest.CriteriaCount == 0) |
||||
{ |
||||
throw new ArgumentException("No criteria specified.", new InvalidOperationException()); |
||||
} |
||||
SearchResponse.Builder resp = SearchResponse.CreateBuilder(); |
||||
foreach (string criteria in searchRequest.CriteriaList) |
||||
{ |
||||
resp.AddResults( |
||||
SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://search.com"). |
||||
Build()); |
||||
} |
||||
return resp.Build(); |
||||
} |
||||
|
||||
SearchResponse ISearchService.RefineSearch(RefineSearchRequest refineSearchRequest) |
||||
{ |
||||
SearchResponse.Builder resp = refineSearchRequest.PreviousResults.ToBuilder(); |
||||
foreach (string criteria in refineSearchRequest.CriteriaList) |
||||
{ |
||||
resp.AddResults( |
||||
SearchResponse.Types.ResultItem.CreateBuilder().SetName(criteria).SetUrl("http://refine.com"). |
||||
Build()); |
||||
} |
||||
return resp.Build(); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// An example extraction of the wire protocol |
||||
/// </summary> |
||||
private interface IWireTransfer |
||||
{ |
||||
byte[] Execute(string method, byte[] message); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// An example of a server responding to a wire request |
||||
/// </summary> |
||||
private class ExampleServerHost : IWireTransfer |
||||
{ |
||||
private readonly IRpcServerStub _stub; |
||||
|
||||
public ExampleServerHost(ISearchService implementation) |
||||
{ |
||||
//on the server, we create a dispatch to call the appropriate method by name |
||||
IRpcDispatch dispatch = new SearchService.Dispatch(implementation); |
||||
//we then wrap that dispatch in a server stub which will deserialize the wire bytes to the message |
||||
//type appropriate for the method name being invoked. |
||||
_stub = new SearchService.ServerStub(dispatch); |
||||
} |
||||
|
||||
byte[] IWireTransfer.Execute(string method, byte[] message) |
||||
{ |
||||
//now when we recieve a wire transmission to invoke a method by name with a byte[] or stream payload |
||||
//we just simply call the sub: |
||||
IMessageLite response = _stub.CallMethod(method, CodedInputStream.CreateInstance(message), |
||||
ExtensionRegistry.Empty); |
||||
//now we return the expected response message: |
||||
return response.ToByteArray(); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// An example of a client sending a wire request |
||||
/// </summary> |
||||
private class ExampleClient : IRpcDispatch |
||||
{ |
||||
private readonly IWireTransfer _wire; |
||||
|
||||
public ExampleClient(IWireTransfer wire) |
||||
{ |
||||
_wire = wire; |
||||
} |
||||
|
||||
TMessage IRpcDispatch.CallMethod<TMessage, TBuilder>(string method, IMessageLite request, |
||||
IBuilderLite<TMessage, TBuilder> response) |
||||
{ |
||||
byte[] rawResponse = _wire.Execute(method, request.ToByteArray()); |
||||
response.MergeFrom(rawResponse); |
||||
return response.Build(); |
||||
} |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Put it all together to create one seamless client/server experience full of rich-type goodness ;) |
||||
/// All you need to do is send/recieve the method name and message bytes across the wire. |
||||
/// </summary> |
||||
[TestMethod] |
||||
public void TestClientServerDispatch() |
||||
{ |
||||
ExampleServerHost server = new ExampleServerHost(new ExampleSearchImpl()); |
||||
//obviously if this was a 'real' transport we would not use the server, rather the server would be listening, the client transmitting |
||||
IWireTransfer wire = server; |
||||
|
||||
ISearchService client = new SearchService(new ExampleClient(wire)); |
||||
//now the client has a real, typed, interface to work with: |
||||
SearchResponse result = client.Search(SearchRequest.CreateBuilder().AddCriteria("Test").Build()); |
||||
Assert.AreEqual(1, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
//The test part of this, call the only other method |
||||
result = |
||||
client.RefineSearch( |
||||
RefineSearchRequest.CreateBuilder().SetPreviousResults(result).AddCriteria("Refine").Build()); |
||||
Assert.AreEqual(2, result.ResultsCount); |
||||
Assert.AreEqual("Test", result.ResultsList[0].Name); |
||||
Assert.AreEqual("http://search.com", result.ResultsList[0].Url); |
||||
|
||||
Assert.AreEqual("Refine", result.ResultsList[1].Name); |
||||
Assert.AreEqual("http://refine.com", result.ResultsList[1].Url); |
||||
} |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,346 +1,347 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestImportProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder> internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnitTestImportProtoFile() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CiVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0LnByb3RvEhhwcm90", |
||||
"b2J1Zl91bml0dGVzdF9pbXBvcnQaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBf", |
||||
"b3B0aW9ucy5wcm90byIaCg1JbXBvcnRNZXNzYWdlEgkKAWQYASABKAUqPAoK", |
||||
"SW1wb3J0RW51bRIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JBUhAIEg4K", |
||||
"CklNUE9SVF9CQVoQCUJbChhjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3RIAcI+", |
||||
"PAohR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9zEhdVbml0VGVz", |
||||
"dEltcG9ydFByb3RvRmlsZQ==")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder>(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, |
||||
new string[] { "D", }); |
||||
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 |
||||
public enum ImportEnum { |
||||
IMPORT_FOO = 7, |
||||
IMPORT_BAR = 8, |
||||
IMPORT_BAZ = 9, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class ImportMessage : pb::GeneratedMessage<ImportMessage, ImportMessage.Builder> { |
||||
private ImportMessage() { } |
||||
private static readonly ImportMessage defaultInstance = new ImportMessage().MakeReadOnly(); |
||||
private static readonly string[] _importMessageFieldNames = new string[] { "d" }; |
||||
private static readonly uint[] _importMessageFieldTags = new uint[] { 8 }; |
||||
public static ImportMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override ImportMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<ImportMessage, ImportMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int DFieldNumber = 1; |
||||
private bool hasD; |
||||
private int d_; |
||||
public bool HasD { |
||||
get { return hasD; } |
||||
} |
||||
public int D { |
||||
get { return d_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _importMessageFieldNames; |
||||
if (hasD) { |
||||
output.WriteInt32(1, field_names[0], D); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasD) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private ImportMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(ImportMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<ImportMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(ImportMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private ImportMessage result; |
||||
|
||||
private ImportMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
ImportMessage original = result; |
||||
result = new ImportMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override ImportMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.Descriptor; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is ImportMessage) { |
||||
return MergeFrom((ImportMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(ImportMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasD) { |
||||
D = other.D; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_importMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _importMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasD = input.ReadInt32(ref result.d_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasD { |
||||
get { return result.hasD; } |
||||
} |
||||
public int D { |
||||
get { return result.D; } |
||||
set { SetD(value); } |
||||
} |
||||
public Builder SetD(int value) { |
||||
PrepareBuilder(); |
||||
result.hasD = true; |
||||
result.d_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearD() { |
||||
PrepareBuilder(); |
||||
result.hasD = false; |
||||
result.d_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static ImportMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_import.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestImport { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder> internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnittestImport() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"CiVnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0LnByb3RvEhhwcm90", |
||||
"b2J1Zl91bml0dGVzdF9pbXBvcnQaLGdvb2dsZS9wcm90b2J1Zi91bml0dGVz", |
||||
"dF9pbXBvcnRfcHVibGljLnByb3RvIhoKDUltcG9ydE1lc3NhZ2USCQoBZBgB", |
||||
"IAEoBSo8CgpJbXBvcnRFbnVtEg4KCklNUE9SVF9GT08QBxIOCgpJTVBPUlRf", |
||||
"QkFSEAgSDgoKSU1QT1JUX0JBWhAJQkMKGGNvbS5nb29nbGUucHJvdG9idWYu", |
||||
"dGVzdEgB+AEBqgIhR29vZ2xlLlByb3RvY29sQnVmZmVycy5UZXN0UHJvdG9z", |
||||
"UAA=")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.ImportMessage, global::Google.ProtocolBuffers.TestProtos.ImportMessage.Builder>(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, |
||||
new string[] { "D", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.Descriptor, |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Enums |
||||
public enum ImportEnum { |
||||
IMPORT_FOO = 7, |
||||
IMPORT_BAR = 8, |
||||
IMPORT_BAZ = 9, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class ImportMessage : pb::GeneratedMessage<ImportMessage, ImportMessage.Builder> { |
||||
private ImportMessage() { } |
||||
private static readonly ImportMessage defaultInstance = new ImportMessage().MakeReadOnly(); |
||||
private static readonly string[] _importMessageFieldNames = new string[] { "d" }; |
||||
private static readonly uint[] _importMessageFieldTags = new uint[] { 8 }; |
||||
public static ImportMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override ImportMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImport.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<ImportMessage, ImportMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImport.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int DFieldNumber = 1; |
||||
private bool hasD; |
||||
private int d_; |
||||
public bool HasD { |
||||
get { return hasD; } |
||||
} |
||||
public int D { |
||||
get { return d_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _importMessageFieldNames; |
||||
if (hasD) { |
||||
output.WriteInt32(1, field_names[0], D); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasD) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private ImportMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(ImportMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<ImportMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(ImportMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private ImportMessage result; |
||||
|
||||
private ImportMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
ImportMessage original = result; |
||||
result = new ImportMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override ImportMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.Descriptor; } |
||||
} |
||||
|
||||
public override ImportMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is ImportMessage) { |
||||
return MergeFrom((ImportMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(ImportMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasD) { |
||||
D = other.D; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_importMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _importMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasD = input.ReadInt32(ref result.d_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasD { |
||||
get { return result.hasD; } |
||||
} |
||||
public int D { |
||||
get { return result.D; } |
||||
set { SetD(value); } |
||||
} |
||||
public Builder SetD(int value) { |
||||
PrepareBuilder(); |
||||
result.hasD = true; |
||||
result.d_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearD() { |
||||
PrepareBuilder(); |
||||
result.hasD = false; |
||||
result.d_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static ImportMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestImport.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,308 +1,309 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestImportLiteProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Extensions |
||||
internal static readonly object Descriptor; |
||||
static UnitTestImportLiteProtoFile() { |
||||
Descriptor = null; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Enums |
||||
public enum ImportEnumLite { |
||||
IMPORT_LITE_FOO = 7, |
||||
IMPORT_LITE_BAR = 8, |
||||
IMPORT_LITE_BAZ = 9, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class ImportMessageLite : pb::GeneratedMessageLite<ImportMessageLite, ImportMessageLite.Builder> { |
||||
private ImportMessageLite() { } |
||||
private static readonly ImportMessageLite defaultInstance = new ImportMessageLite().MakeReadOnly(); |
||||
private static readonly string[] _importMessageLiteFieldNames = new string[] { "d" }; |
||||
private static readonly uint[] _importMessageLiteFieldTags = new uint[] { 8 }; |
||||
public static ImportMessageLite DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessageLite DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override ImportMessageLite ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public const int DFieldNumber = 1; |
||||
private bool hasD; |
||||
private int d_; |
||||
public bool HasD { |
||||
get { return hasD; } |
||||
} |
||||
public int D { |
||||
get { return d_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _importMessageLiteFieldNames; |
||||
if (hasD) { |
||||
output.WriteInt32(1, field_names[0], D); |
||||
} |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasD) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D); |
||||
} |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
#region Lite runtime methods |
||||
public override int GetHashCode() { |
||||
int hash = GetType().GetHashCode(); |
||||
if (hasD) hash ^= d_.GetHashCode(); |
||||
return hash; |
||||
} |
||||
|
||||
public override bool Equals(object obj) { |
||||
ImportMessageLite other = obj as ImportMessageLite; |
||||
if (other == null) return false; |
||||
if (hasD != other.hasD || (hasD && !d_.Equals(other.d_))) return false; |
||||
return true; |
||||
} |
||||
|
||||
public override void PrintTo(global::System.IO.TextWriter writer) { |
||||
PrintField("d", hasD, d_, writer); |
||||
} |
||||
#endregion |
||||
|
||||
public static ImportMessageLite ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private ImportMessageLite MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(ImportMessageLite prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilderLite<ImportMessageLite, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(ImportMessageLite cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private ImportMessageLite result; |
||||
|
||||
private ImportMessageLite PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
ImportMessageLite original = result; |
||||
result = new ImportMessageLite(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override ImportMessageLite MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override ImportMessageLite DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessageLite BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessageLite other) { |
||||
if (other is ImportMessageLite) { |
||||
return MergeFrom((ImportMessageLite) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(ImportMessageLite other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasD) { |
||||
D = other.D; |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_importMessageLiteFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _importMessageLiteFieldTags[field_ordinal]; |
||||
else { |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
default: { |
||||
if (pb::WireFormat.IsEndGroupTag(tag)) { |
||||
return this; |
||||
} |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasD = input.ReadInt32(ref result.d_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasD { |
||||
get { return result.hasD; } |
||||
} |
||||
public int D { |
||||
get { return result.D; } |
||||
set { SetD(value); } |
||||
} |
||||
public Builder SetD(int value) { |
||||
PrepareBuilder(); |
||||
result.hasD = true; |
||||
result.d_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearD() { |
||||
PrepareBuilder(); |
||||
result.hasD = false; |
||||
result.d_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static ImportMessageLite() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportLiteProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_import_lite.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestImportLite { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Extensions |
||||
internal static readonly object Descriptor; |
||||
static UnittestImportLite() { |
||||
Descriptor = null; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Enums |
||||
public enum ImportEnumLite { |
||||
IMPORT_LITE_FOO = 7, |
||||
IMPORT_LITE_BAR = 8, |
||||
IMPORT_LITE_BAZ = 9, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class ImportMessageLite : pb::GeneratedMessageLite<ImportMessageLite, ImportMessageLite.Builder> { |
||||
private ImportMessageLite() { } |
||||
private static readonly ImportMessageLite defaultInstance = new ImportMessageLite().MakeReadOnly(); |
||||
private static readonly string[] _importMessageLiteFieldNames = new string[] { "d" }; |
||||
private static readonly uint[] _importMessageLiteFieldTags = new uint[] { 8 }; |
||||
public static ImportMessageLite DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessageLite DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override ImportMessageLite ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public const int DFieldNumber = 1; |
||||
private bool hasD; |
||||
private int d_; |
||||
public bool HasD { |
||||
get { return hasD; } |
||||
} |
||||
public int D { |
||||
get { return d_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _importMessageLiteFieldNames; |
||||
if (hasD) { |
||||
output.WriteInt32(1, field_names[0], D); |
||||
} |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasD) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D); |
||||
} |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
#region Lite runtime methods |
||||
public override int GetHashCode() { |
||||
int hash = GetType().GetHashCode(); |
||||
if (hasD) hash ^= d_.GetHashCode(); |
||||
return hash; |
||||
} |
||||
|
||||
public override bool Equals(object obj) { |
||||
ImportMessageLite other = obj as ImportMessageLite; |
||||
if (other == null) return false; |
||||
if (hasD != other.hasD || (hasD && !d_.Equals(other.d_))) return false; |
||||
return true; |
||||
} |
||||
|
||||
public override void PrintTo(global::System.IO.TextWriter writer) { |
||||
PrintField("d", hasD, d_, writer); |
||||
} |
||||
#endregion |
||||
|
||||
public static ImportMessageLite ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private ImportMessageLite MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(ImportMessageLite prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilderLite<ImportMessageLite, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(ImportMessageLite cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private ImportMessageLite result; |
||||
|
||||
private ImportMessageLite PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
ImportMessageLite original = result; |
||||
result = new ImportMessageLite(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override ImportMessageLite MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override ImportMessageLite DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessageLite BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessageLite other) { |
||||
if (other is ImportMessageLite) { |
||||
return MergeFrom((ImportMessageLite) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(ImportMessageLite other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasD) { |
||||
D = other.D; |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_importMessageLiteFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _importMessageLiteFieldTags[field_ordinal]; |
||||
else { |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
default: { |
||||
if (pb::WireFormat.IsEndGroupTag(tag)) { |
||||
return this; |
||||
} |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasD = input.ReadInt32(ref result.d_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasD { |
||||
get { return result.hasD; } |
||||
} |
||||
public int D { |
||||
get { return result.D; } |
||||
set { SetD(value); } |
||||
} |
||||
public Builder SetD(int value) { |
||||
PrepareBuilder(); |
||||
result.hasD = true; |
||||
result.d_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearD() { |
||||
PrepareBuilder(); |
||||
result.hasD = false; |
||||
result.d_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static ImportMessageLite() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestImportLite.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -0,0 +1,333 @@ |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_import_public.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestImportPublic { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor; |
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.PublicImportMessage, global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.Builder> internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; |
||||
#endregion |
||||
#region Descriptor |
||||
public static pbd::FileDescriptor Descriptor { |
||||
get { return descriptor; } |
||||
} |
||||
private static pbd::FileDescriptor descriptor; |
||||
|
||||
static UnittestImportPublic() { |
||||
byte[] descriptorData = global::System.Convert.FromBase64String( |
||||
string.Concat( |
||||
"Cixnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpYy5wcm90", |
||||
"bxIYcHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0IiAKE1B1YmxpY0ltcG9ydE1l", |
||||
"c3NhZ2USCQoBZRgBIAEoBUI+Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRlc3Sq", |
||||
"AiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3M=")); |
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { |
||||
descriptor = root; |
||||
internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor = Descriptor.MessageTypes[0]; |
||||
internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable = |
||||
new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.PublicImportMessage, global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.Builder>(internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor, |
||||
new string[] { "E", }); |
||||
pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); |
||||
RegisterAllExtensions(registry); |
||||
return registry; |
||||
}; |
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
||||
new pbd::FileDescriptor[] { |
||||
}, assigner); |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class PublicImportMessage : pb::GeneratedMessage<PublicImportMessage, PublicImportMessage.Builder> { |
||||
private PublicImportMessage() { } |
||||
private static readonly PublicImportMessage defaultInstance = new PublicImportMessage().MakeReadOnly(); |
||||
private static readonly string[] _publicImportMessageFieldNames = new string[] { "e" }; |
||||
private static readonly uint[] _publicImportMessageFieldTags = new uint[] { 8 }; |
||||
public static PublicImportMessage DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override PublicImportMessage DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override PublicImportMessage ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public static pbd::MessageDescriptor Descriptor { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor; } |
||||
} |
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<PublicImportMessage, PublicImportMessage.Builder> InternalFieldAccessors { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; } |
||||
} |
||||
|
||||
public const int EFieldNumber = 1; |
||||
private bool hasE; |
||||
private int e_; |
||||
public bool HasE { |
||||
get { return hasE; } |
||||
} |
||||
public int E { |
||||
get { return e_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _publicImportMessageFieldNames; |
||||
if (hasE) { |
||||
output.WriteInt32(1, field_names[0], E); |
||||
} |
||||
UnknownFields.WriteTo(output); |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasE) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, E); |
||||
} |
||||
size += UnknownFields.SerializedSize; |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private PublicImportMessage MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(PublicImportMessage prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilder<PublicImportMessage, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(PublicImportMessage cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private PublicImportMessage result; |
||||
|
||||
private PublicImportMessage PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
PublicImportMessage original = result; |
||||
result = new PublicImportMessage(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override PublicImportMessage MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.Descriptor; } |
||||
} |
||||
|
||||
public override PublicImportMessage DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.DefaultInstance; } |
||||
} |
||||
|
||||
public override PublicImportMessage BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) { |
||||
if (other is PublicImportMessage) { |
||||
return MergeFrom((PublicImportMessage) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(PublicImportMessage other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.PublicImportMessage.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasE) { |
||||
E = other.E; |
||||
} |
||||
this.MergeUnknownFields(other.UnknownFields); |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
pb::UnknownFieldSet.Builder unknownFields = null; |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_publicImportMessageFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _publicImportMessageFieldTags[field_ordinal]; |
||||
else { |
||||
if (unknownFields == null) { |
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
||||
} |
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
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, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasE = input.ReadInt32(ref result.e_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (unknownFields != null) { |
||||
this.UnknownFields = unknownFields.Build(); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasE { |
||||
get { return result.hasE; } |
||||
} |
||||
public int E { |
||||
get { return result.E; } |
||||
set { SetE(value); } |
||||
} |
||||
public Builder SetE(int value) { |
||||
PrepareBuilder(); |
||||
result.hasE = true; |
||||
result.e_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearE() { |
||||
PrepareBuilder(); |
||||
result.hasE = false; |
||||
result.e_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static PublicImportMessage() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestImportPublic.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
@ -1,308 +1,300 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestImportLiteProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Extensions |
||||
internal static readonly object Descriptor; |
||||
static UnitTestImportLiteProtoFile() { |
||||
Descriptor = null; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Enums |
||||
public enum ImportEnumLite { |
||||
IMPORT_LITE_FOO = 7, |
||||
IMPORT_LITE_BAR = 8, |
||||
IMPORT_LITE_BAZ = 9, |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class ImportMessageLite : pb::GeneratedMessageLite<ImportMessageLite, ImportMessageLite.Builder> { |
||||
private ImportMessageLite() { } |
||||
private static readonly ImportMessageLite defaultInstance = new ImportMessageLite().MakeReadOnly(); |
||||
private static readonly string[] _importMessageLiteFieldNames = new string[] { "d" }; |
||||
private static readonly uint[] _importMessageLiteFieldTags = new uint[] { 8 }; |
||||
public static ImportMessageLite DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessageLite DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override ImportMessageLite ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public const int DFieldNumber = 1; |
||||
private bool hasD; |
||||
private int d_; |
||||
public bool HasD { |
||||
get { return hasD; } |
||||
} |
||||
public int D { |
||||
get { return d_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _importMessageLiteFieldNames; |
||||
if (hasD) { |
||||
output.WriteInt32(1, field_names[0], D); |
||||
} |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasD) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D); |
||||
} |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
#region Lite runtime methods |
||||
public override int GetHashCode() { |
||||
int hash = GetType().GetHashCode(); |
||||
if (hasD) hash ^= d_.GetHashCode(); |
||||
return hash; |
||||
} |
||||
|
||||
public override bool Equals(object obj) { |
||||
ImportMessageLite other = obj as ImportMessageLite; |
||||
if (other == null) return false; |
||||
if (hasD != other.hasD || (hasD && !d_.Equals(other.d_))) return false; |
||||
return true; |
||||
} |
||||
|
||||
public override void PrintTo(global::System.IO.TextWriter writer) { |
||||
PrintField("d", hasD, d_, writer); |
||||
} |
||||
#endregion |
||||
|
||||
public static ImportMessageLite ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static ImportMessageLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private ImportMessageLite MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(ImportMessageLite prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilderLite<ImportMessageLite, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(ImportMessageLite cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private ImportMessageLite result; |
||||
|
||||
private ImportMessageLite PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
ImportMessageLite original = result; |
||||
result = new ImportMessageLite(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override ImportMessageLite MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override ImportMessageLite DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance; } |
||||
} |
||||
|
||||
public override ImportMessageLite BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessageLite other) { |
||||
if (other is ImportMessageLite) { |
||||
return MergeFrom((ImportMessageLite) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(ImportMessageLite other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.ImportMessageLite.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasD) { |
||||
D = other.D; |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_importMessageLiteFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _importMessageLiteFieldTags[field_ordinal]; |
||||
else { |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
default: { |
||||
if (pb::WireFormat.IsEndGroupTag(tag)) { |
||||
return this; |
||||
} |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasD = input.ReadInt32(ref result.d_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasD { |
||||
get { return result.hasD; } |
||||
} |
||||
public int D { |
||||
get { return result.D; } |
||||
set { SetD(value); } |
||||
} |
||||
public Builder SetD(int value) { |
||||
PrepareBuilder(); |
||||
result.hasD = true; |
||||
result.d_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearD() { |
||||
PrepareBuilder(); |
||||
result.hasD = false; |
||||
result.d_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static ImportMessageLite() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestImportLiteProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_import_public_lite.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestImportPublicLite { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Extensions |
||||
internal static readonly object Descriptor; |
||||
static UnittestImportPublicLite() { |
||||
Descriptor = null; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class PublicImportMessageLite : pb::GeneratedMessageLite<PublicImportMessageLite, PublicImportMessageLite.Builder> { |
||||
private PublicImportMessageLite() { } |
||||
private static readonly PublicImportMessageLite defaultInstance = new PublicImportMessageLite().MakeReadOnly(); |
||||
private static readonly string[] _publicImportMessageLiteFieldNames = new string[] { "e" }; |
||||
private static readonly uint[] _publicImportMessageLiteFieldTags = new uint[] { 8 }; |
||||
public static PublicImportMessageLite DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override PublicImportMessageLite DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override PublicImportMessageLite ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public const int EFieldNumber = 1; |
||||
private bool hasE; |
||||
private int e_; |
||||
public bool HasE { |
||||
get { return hasE; } |
||||
} |
||||
public int E { |
||||
get { return e_; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _publicImportMessageLiteFieldNames; |
||||
if (hasE) { |
||||
output.WriteInt32(1, field_names[0], E); |
||||
} |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasE) { |
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, E); |
||||
} |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
#region Lite runtime methods |
||||
public override int GetHashCode() { |
||||
int hash = GetType().GetHashCode(); |
||||
if (hasE) hash ^= e_.GetHashCode(); |
||||
return hash; |
||||
} |
||||
|
||||
public override bool Equals(object obj) { |
||||
PublicImportMessageLite other = obj as PublicImportMessageLite; |
||||
if (other == null) return false; |
||||
if (hasE != other.hasE || (hasE && !e_.Equals(other.e_))) return false; |
||||
return true; |
||||
} |
||||
|
||||
public override void PrintTo(global::System.IO.TextWriter writer) { |
||||
PrintField("e", hasE, e_, writer); |
||||
} |
||||
#endregion |
||||
|
||||
public static PublicImportMessageLite ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static PublicImportMessageLite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private PublicImportMessageLite MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(PublicImportMessageLite prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilderLite<PublicImportMessageLite, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(PublicImportMessageLite cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private PublicImportMessageLite result; |
||||
|
||||
private PublicImportMessageLite PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
PublicImportMessageLite original = result; |
||||
result = new PublicImportMessageLite(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override PublicImportMessageLite MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override PublicImportMessageLite DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.PublicImportMessageLite.DefaultInstance; } |
||||
} |
||||
|
||||
public override PublicImportMessageLite BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessageLite other) { |
||||
if (other is PublicImportMessageLite) { |
||||
return MergeFrom((PublicImportMessageLite) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(PublicImportMessageLite other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.PublicImportMessageLite.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasE) { |
||||
E = other.E; |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_publicImportMessageLiteFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _publicImportMessageLiteFieldTags[field_ordinal]; |
||||
else { |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
default: { |
||||
if (pb::WireFormat.IsEndGroupTag(tag)) { |
||||
return this; |
||||
} |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
break; |
||||
} |
||||
case 8: { |
||||
result.hasE = input.ReadInt32(ref result.e_); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasE { |
||||
get { return result.hasE; } |
||||
} |
||||
public int E { |
||||
get { return result.E; } |
||||
set { SetE(value); } |
||||
} |
||||
public Builder SetE(int value) { |
||||
PrepareBuilder(); |
||||
result.hasE = true; |
||||
result.e_ = value; |
||||
return this; |
||||
} |
||||
public Builder ClearE() { |
||||
PrepareBuilder(); |
||||
result.hasE = false; |
||||
result.e_ = 0; |
||||
return this; |
||||
} |
||||
} |
||||
static PublicImportMessageLite() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestImportPublicLite.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,324 +1,325 @@ |
||||
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnitTestLiteImportNonLiteProtoFile { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Extensions |
||||
internal static readonly object Descriptor; |
||||
static UnitTestLiteImportNonLiteProtoFile() { |
||||
Descriptor = null; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class TestLiteImportsNonlite : pb::GeneratedMessageLite<TestLiteImportsNonlite, TestLiteImportsNonlite.Builder> { |
||||
private TestLiteImportsNonlite() { } |
||||
private static readonly TestLiteImportsNonlite defaultInstance = new TestLiteImportsNonlite().MakeReadOnly(); |
||||
private static readonly string[] _testLiteImportsNonliteFieldNames = new string[] { "message" }; |
||||
private static readonly uint[] _testLiteImportsNonliteFieldTags = new uint[] { 10 }; |
||||
public static TestLiteImportsNonlite DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override TestLiteImportsNonlite DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override TestLiteImportsNonlite ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public const int MessageFieldNumber = 1; |
||||
private bool hasMessage; |
||||
private global::Google.ProtocolBuffers.TestProtos.TestAllTypes message_; |
||||
public bool HasMessage { |
||||
get { return hasMessage; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestAllTypes Message { |
||||
get { return message_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _testLiteImportsNonliteFieldNames; |
||||
if (hasMessage) { |
||||
output.WriteMessage(1, field_names[0], Message); |
||||
} |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasMessage) { |
||||
size += pb::CodedOutputStream.ComputeMessageSize(1, Message); |
||||
} |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
#region Lite runtime methods |
||||
public override int GetHashCode() { |
||||
int hash = GetType().GetHashCode(); |
||||
if (hasMessage) hash ^= message_.GetHashCode(); |
||||
return hash; |
||||
} |
||||
|
||||
public override bool Equals(object obj) { |
||||
TestLiteImportsNonlite other = obj as TestLiteImportsNonlite; |
||||
if (other == null) return false; |
||||
if (hasMessage != other.hasMessage || (hasMessage && !message_.Equals(other.message_))) return false; |
||||
return true; |
||||
} |
||||
|
||||
public override void PrintTo(global::System.IO.TextWriter writer) { |
||||
PrintField("message", hasMessage, message_, writer); |
||||
} |
||||
#endregion |
||||
|
||||
public static TestLiteImportsNonlite ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private TestLiteImportsNonlite MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(TestLiteImportsNonlite prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilderLite<TestLiteImportsNonlite, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(TestLiteImportsNonlite cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private TestLiteImportsNonlite result; |
||||
|
||||
private TestLiteImportsNonlite PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
TestLiteImportsNonlite original = result; |
||||
result = new TestLiteImportsNonlite(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override TestLiteImportsNonlite MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override TestLiteImportsNonlite DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.TestLiteImportsNonlite.DefaultInstance; } |
||||
} |
||||
|
||||
public override TestLiteImportsNonlite BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessageLite other) { |
||||
if (other is TestLiteImportsNonlite) { |
||||
return MergeFrom((TestLiteImportsNonlite) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(TestLiteImportsNonlite other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.TestLiteImportsNonlite.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasMessage) { |
||||
MergeMessage(other.Message); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_testLiteImportsNonliteFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _testLiteImportsNonliteFieldTags[field_ordinal]; |
||||
else { |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
default: { |
||||
if (pb::WireFormat.IsEndGroupTag(tag)) { |
||||
return this; |
||||
} |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
break; |
||||
} |
||||
case 10: { |
||||
global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(); |
||||
if (result.hasMessage) { |
||||
subBuilder.MergeFrom(Message); |
||||
} |
||||
input.ReadMessage(subBuilder, extensionRegistry); |
||||
Message = subBuilder.BuildPartial(); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasMessage { |
||||
get { return result.hasMessage; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestAllTypes Message { |
||||
get { return result.Message; } |
||||
set { SetMessage(value); } |
||||
} |
||||
public Builder SetMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.hasMessage = true; |
||||
result.message_ = value; |
||||
return this; |
||||
} |
||||
public Builder SetMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { |
||||
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
||||
PrepareBuilder(); |
||||
result.hasMessage = true; |
||||
result.message_ = builderForValue.Build(); |
||||
return this; |
||||
} |
||||
public Builder MergeMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
if (result.hasMessage && |
||||
result.message_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) { |
||||
result.message_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(result.message_).MergeFrom(value).BuildPartial(); |
||||
} else { |
||||
result.message_ = value; |
||||
} |
||||
result.hasMessage = true; |
||||
return this; |
||||
} |
||||
public Builder ClearMessage() { |
||||
PrepareBuilder(); |
||||
result.hasMessage = false; |
||||
result.message_ = null; |
||||
return this; |
||||
} |
||||
} |
||||
static TestLiteImportsNonlite() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnitTestLiteImportNonLiteProtoFile.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
||||
// Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
// source: google/protobuf/unittest_lite_imports_nonlite.proto |
||||
#pragma warning disable 1591, 0612, 3021 |
||||
#region Designer generated code |
||||
|
||||
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()] |
||||
public static partial class UnittestLiteImportsNonlite { |
||||
|
||||
#region Extension registration |
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { |
||||
} |
||||
#endregion |
||||
#region Static variables |
||||
#endregion |
||||
#region Extensions |
||||
internal static readonly object Descriptor; |
||||
static UnittestLiteImportsNonlite() { |
||||
Descriptor = null; |
||||
} |
||||
#endregion |
||||
|
||||
} |
||||
#region Messages |
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class TestLiteImportsNonlite : pb::GeneratedMessageLite<TestLiteImportsNonlite, TestLiteImportsNonlite.Builder> { |
||||
private TestLiteImportsNonlite() { } |
||||
private static readonly TestLiteImportsNonlite defaultInstance = new TestLiteImportsNonlite().MakeReadOnly(); |
||||
private static readonly string[] _testLiteImportsNonliteFieldNames = new string[] { "message" }; |
||||
private static readonly uint[] _testLiteImportsNonliteFieldTags = new uint[] { 10 }; |
||||
public static TestLiteImportsNonlite DefaultInstance { |
||||
get { return defaultInstance; } |
||||
} |
||||
|
||||
public override TestLiteImportsNonlite DefaultInstanceForType { |
||||
get { return DefaultInstance; } |
||||
} |
||||
|
||||
protected override TestLiteImportsNonlite ThisMessage { |
||||
get { return this; } |
||||
} |
||||
|
||||
public const int MessageFieldNumber = 1; |
||||
private bool hasMessage; |
||||
private global::Google.ProtocolBuffers.TestProtos.TestAllTypes message_; |
||||
public bool HasMessage { |
||||
get { return hasMessage; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestAllTypes Message { |
||||
get { return message_ ?? global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance; } |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void WriteTo(pb::ICodedOutputStream output) { |
||||
CalcSerializedSize(); |
||||
string[] field_names = _testLiteImportsNonliteFieldNames; |
||||
if (hasMessage) { |
||||
output.WriteMessage(1, field_names[0], Message); |
||||
} |
||||
} |
||||
|
||||
private int memoizedSerializedSize = -1; |
||||
public override int SerializedSize { |
||||
get { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
return CalcSerializedSize(); |
||||
} |
||||
} |
||||
|
||||
private int CalcSerializedSize() { |
||||
int size = memoizedSerializedSize; |
||||
if (size != -1) return size; |
||||
|
||||
size = 0; |
||||
if (hasMessage) { |
||||
size += pb::CodedOutputStream.ComputeMessageSize(1, Message); |
||||
} |
||||
memoizedSerializedSize = size; |
||||
return size; |
||||
} |
||||
#region Lite runtime methods |
||||
public override int GetHashCode() { |
||||
int hash = GetType().GetHashCode(); |
||||
if (hasMessage) hash ^= message_.GetHashCode(); |
||||
return hash; |
||||
} |
||||
|
||||
public override bool Equals(object obj) { |
||||
TestLiteImportsNonlite other = obj as TestLiteImportsNonlite; |
||||
if (other == null) return false; |
||||
if (hasMessage != other.hasMessage || (hasMessage && !message_.Equals(other.message_))) return false; |
||||
return true; |
||||
} |
||||
|
||||
public override void PrintTo(global::System.IO.TextWriter writer) { |
||||
PrintField("message", hasMessage, message_, writer); |
||||
} |
||||
#endregion |
||||
|
||||
public static TestLiteImportsNonlite ParseFrom(pb::ByteString data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(byte[] data) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(global::System.IO.Stream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseDelimitedFrom(global::System.IO.Stream input) { |
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(pb::ICodedInputStream input) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
||||
} |
||||
public static TestLiteImportsNonlite ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
||||
} |
||||
private TestLiteImportsNonlite MakeReadOnly() { |
||||
return this; |
||||
} |
||||
|
||||
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(TestLiteImportsNonlite prototype) { |
||||
return new Builder(prototype); |
||||
} |
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||
public sealed partial class Builder : pb::GeneratedBuilderLite<TestLiteImportsNonlite, Builder> { |
||||
protected override Builder ThisBuilder { |
||||
get { return this; } |
||||
} |
||||
public Builder() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
} |
||||
internal Builder(TestLiteImportsNonlite cloneFrom) { |
||||
result = cloneFrom; |
||||
resultIsReadOnly = true; |
||||
} |
||||
|
||||
private bool resultIsReadOnly; |
||||
private TestLiteImportsNonlite result; |
||||
|
||||
private TestLiteImportsNonlite PrepareBuilder() { |
||||
if (resultIsReadOnly) { |
||||
TestLiteImportsNonlite original = result; |
||||
result = new TestLiteImportsNonlite(); |
||||
resultIsReadOnly = false; |
||||
MergeFrom(original); |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
public override bool IsInitialized { |
||||
get { return result.IsInitialized; } |
||||
} |
||||
|
||||
protected override TestLiteImportsNonlite MessageBeingBuilt { |
||||
get { return PrepareBuilder(); } |
||||
} |
||||
|
||||
public override Builder Clear() { |
||||
result = DefaultInstance; |
||||
resultIsReadOnly = true; |
||||
return this; |
||||
} |
||||
|
||||
public override Builder Clone() { |
||||
if (resultIsReadOnly) { |
||||
return new Builder(result); |
||||
} else { |
||||
return new Builder().MergeFrom(result); |
||||
} |
||||
} |
||||
|
||||
public override TestLiteImportsNonlite DefaultInstanceForType { |
||||
get { return global::Google.ProtocolBuffers.TestProtos.TestLiteImportsNonlite.DefaultInstance; } |
||||
} |
||||
|
||||
public override TestLiteImportsNonlite BuildPartial() { |
||||
if (resultIsReadOnly) { |
||||
return result; |
||||
} |
||||
resultIsReadOnly = true; |
||||
return result.MakeReadOnly(); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::IMessageLite other) { |
||||
if (other is TestLiteImportsNonlite) { |
||||
return MergeFrom((TestLiteImportsNonlite) other); |
||||
} else { |
||||
base.MergeFrom(other); |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public override Builder MergeFrom(TestLiteImportsNonlite other) { |
||||
if (other == global::Google.ProtocolBuffers.TestProtos.TestLiteImportsNonlite.DefaultInstance) return this; |
||||
PrepareBuilder(); |
||||
if (other.HasMessage) { |
||||
MergeMessage(other.Message); |
||||
} |
||||
return this; |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input) { |
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty); |
||||
} |
||||
|
||||
public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
||||
PrepareBuilder(); |
||||
uint tag; |
||||
string field_name; |
||||
while (input.ReadTag(out tag, out field_name)) { |
||||
if(tag == 0 && field_name != null) { |
||||
int field_ordinal = global::System.Array.BinarySearch(_testLiteImportsNonliteFieldNames, field_name, global::System.StringComparer.Ordinal); |
||||
if(field_ordinal >= 0) |
||||
tag = _testLiteImportsNonliteFieldTags[field_ordinal]; |
||||
else { |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
continue; |
||||
} |
||||
} |
||||
switch (tag) { |
||||
case 0: { |
||||
throw pb::InvalidProtocolBufferException.InvalidTag(); |
||||
} |
||||
default: { |
||||
if (pb::WireFormat.IsEndGroupTag(tag)) { |
||||
return this; |
||||
} |
||||
ParseUnknownField(input, extensionRegistry, tag, field_name); |
||||
break; |
||||
} |
||||
case 10: { |
||||
global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(); |
||||
if (result.hasMessage) { |
||||
subBuilder.MergeFrom(Message); |
||||
} |
||||
input.ReadMessage(subBuilder, extensionRegistry); |
||||
Message = subBuilder.BuildPartial(); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
|
||||
|
||||
public bool HasMessage { |
||||
get { return result.hasMessage; } |
||||
} |
||||
public global::Google.ProtocolBuffers.TestProtos.TestAllTypes Message { |
||||
get { return result.Message; } |
||||
set { SetMessage(value); } |
||||
} |
||||
public Builder SetMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
result.hasMessage = true; |
||||
result.message_ = value; |
||||
return this; |
||||
} |
||||
public Builder SetMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes.Builder builderForValue) { |
||||
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
||||
PrepareBuilder(); |
||||
result.hasMessage = true; |
||||
result.message_ = builderForValue.Build(); |
||||
return this; |
||||
} |
||||
public Builder MergeMessage(global::Google.ProtocolBuffers.TestProtos.TestAllTypes value) { |
||||
pb::ThrowHelper.ThrowIfNull(value, "value"); |
||||
PrepareBuilder(); |
||||
if (result.hasMessage && |
||||
result.message_ != global::Google.ProtocolBuffers.TestProtos.TestAllTypes.DefaultInstance) { |
||||
result.message_ = global::Google.ProtocolBuffers.TestProtos.TestAllTypes.CreateBuilder(result.message_).MergeFrom(value).BuildPartial(); |
||||
} else { |
||||
result.message_ = value; |
||||
} |
||||
result.hasMessage = true; |
||||
return this; |
||||
} |
||||
public Builder ClearMessage() { |
||||
PrepareBuilder(); |
||||
result.hasMessage = false; |
||||
result.message_ = null; |
||||
return this; |
||||
} |
||||
} |
||||
static TestLiteImportsNonlite() { |
||||
object.ReferenceEquals(global::Google.ProtocolBuffers.TestProtos.UnittestLiteImportsNonlite.Descriptor, null); |
||||
} |
||||
} |
||||
|
||||
#endregion |
||||
|
||||
} |
||||
|
||||
#endregion Designer generated code |
Loading…
Reference in new issue