aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-08-28 16:31:54 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-09-02 12:58:54 -0700
commit97eaec1cdc28174f1f5bd2bd74aba19f0869d75e (patch)
tree63743b4eed7060ef15fc1d74b726f5f71c8c2341
parent65cccc649bdcf81edb887453cde50d043e82a89a (diff)
first stab at upgrading route_guide to proto3
-rw-r--r--examples/csharp/route_guide/.nuget/packages.config2
-rw-r--r--examples/csharp/route_guide/RouteGuide/RouteGuide.cs2033
-rw-r--r--examples/csharp/route_guide/RouteGuide/RouteGuide.csproj27
-rw-r--r--examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs122
-rw-r--r--examples/csharp/route_guide/RouteGuide/RouteGuideUtil.cs2
-rw-r--r--examples/csharp/route_guide/RouteGuide/packages.config9
-rw-r--r--examples/csharp/route_guide/RouteGuide/protos/route_guide.proto123
-rw-r--r--examples/csharp/route_guide/RouteGuideClient/Program.cs2
-rw-r--r--examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj26
-rw-r--r--examples/csharp/route_guide/RouteGuideClient/packages.config9
-rw-r--r--examples/csharp/route_guide/RouteGuideServer/Program.cs2
-rw-r--r--examples/csharp/route_guide/RouteGuideServer/RouteGuideImpl.cs2
-rw-r--r--examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj26
-rw-r--r--examples/csharp/route_guide/RouteGuideServer/packages.config9
-rw-r--r--examples/csharp/route_guide/generate_protos.bat10
15 files changed, 599 insertions, 1805 deletions
diff --git a/examples/csharp/route_guide/.nuget/packages.config b/examples/csharp/route_guide/.nuget/packages.config
index b14373069f..2ee9042bdb 100644
--- a/examples/csharp/route_guide/.nuget/packages.config
+++ b/examples/csharp/route_guide/.nuget/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Grpc.Tools" version="0.6.0" />
+ <package id="Grpc.Tools" version="0.7.0-preview20150827" />
</packages> \ No newline at end of file
diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs
index 80508bcd3f..9bc6f307d2 100644
--- a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs
+++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs
@@ -3,38 +3,22 @@
#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 pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
-namespace examples {
+namespace Examples {
namespace Proto {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class RouteGuide {
- #region Extension registration
- public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
- }
- #endregion
- #region Static variables
- internal static pbd::MessageDescriptor internal__static_examples_Point__Descriptor;
- internal static pb::FieldAccess.FieldAccessorTable<global::examples.Point, global::examples.Point.Builder> internal__static_examples_Point__FieldAccessorTable;
- internal static pbd::MessageDescriptor internal__static_examples_Rectangle__Descriptor;
- internal static pb::FieldAccess.FieldAccessorTable<global::examples.Rectangle, global::examples.Rectangle.Builder> internal__static_examples_Rectangle__FieldAccessorTable;
- internal static pbd::MessageDescriptor internal__static_examples_Feature__Descriptor;
- internal static pb::FieldAccess.FieldAccessorTable<global::examples.Feature, global::examples.Feature.Builder> internal__static_examples_Feature__FieldAccessorTable;
- internal static pbd::MessageDescriptor internal__static_examples_RouteNote__Descriptor;
- internal static pb::FieldAccess.FieldAccessorTable<global::examples.RouteNote, global::examples.RouteNote.Builder> internal__static_examples_RouteNote__FieldAccessorTable;
- internal static pbd::MessageDescriptor internal__static_examples_RouteSummary__Descriptor;
- internal static pb::FieldAccess.FieldAccessorTable<global::examples.RouteSummary, global::examples.RouteSummary.Builder> internal__static_examples_RouteSummary__FieldAccessorTable;
- #endregion
#region Descriptor
- public static pbd::FileDescriptor Descriptor {
+ public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
- private static pbd::FileDescriptor descriptor;
+ private static pbr::FileDescriptor descriptor;
static RouteGuide() {
byte[] descriptorData = global::System.Convert.FromBase64String(
@@ -52,36 +36,17 @@ namespace examples {
"dXJlcxITLmV4YW1wbGVzLlJlY3RhbmdsZRoRLmV4YW1wbGVzLkZlYXR1cmUi",
"ADABEjoKC1JlY29yZFJvdXRlEg8uZXhhbXBsZXMuUG9pbnQaFi5leGFtcGxl",
"cy5Sb3V0ZVN1bW1hcnkiACgBEjsKCVJvdXRlQ2hhdBITLmV4YW1wbGVzLlJv",
- "dXRlTm90ZRoTLmV4YW1wbGVzLlJvdXRlTm90ZSIAKAEwAQ=="));
- pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
- descriptor = root;
- internal__static_examples_Point__Descriptor = Descriptor.MessageTypes[0];
- internal__static_examples_Point__FieldAccessorTable =
- new pb::FieldAccess.FieldAccessorTable<global::examples.Point, global::examples.Point.Builder>(internal__static_examples_Point__Descriptor,
- new string[] { "Latitude", "Longitude", });
- internal__static_examples_Rectangle__Descriptor = Descriptor.MessageTypes[1];
- internal__static_examples_Rectangle__FieldAccessorTable =
- new pb::FieldAccess.FieldAccessorTable<global::examples.Rectangle, global::examples.Rectangle.Builder>(internal__static_examples_Rectangle__Descriptor,
- new string[] { "Lo", "Hi", });
- internal__static_examples_Feature__Descriptor = Descriptor.MessageTypes[2];
- internal__static_examples_Feature__FieldAccessorTable =
- new pb::FieldAccess.FieldAccessorTable<global::examples.Feature, global::examples.Feature.Builder>(internal__static_examples_Feature__Descriptor,
- new string[] { "Name", "Location", });
- internal__static_examples_RouteNote__Descriptor = Descriptor.MessageTypes[3];
- internal__static_examples_RouteNote__FieldAccessorTable =
- new pb::FieldAccess.FieldAccessorTable<global::examples.RouteNote, global::examples.RouteNote.Builder>(internal__static_examples_RouteNote__Descriptor,
- new string[] { "Location", "Message", });
- internal__static_examples_RouteSummary__Descriptor = Descriptor.MessageTypes[4];
- internal__static_examples_RouteSummary__FieldAccessorTable =
- new pb::FieldAccess.FieldAccessorTable<global::examples.RouteSummary, global::examples.RouteSummary.Builder>(internal__static_examples_RouteSummary__Descriptor,
- new string[] { "PointCount", "FeatureCount", "Distance", "ElapsedTime", });
- pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
- RegisterAllExtensions(registry);
- return registry;
- };
- pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
- new pbd::FileDescriptor[] {
- }, assigner);
+ "dXRlTm90ZRoTLmV4YW1wbGVzLlJvdXRlTm90ZSIAKAEwAUIPCgdleC5ncnBj",
+ "ogIDUlRHYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
+ new pbr::GeneratedCodeInfo(typeof(global::Examples.Point), new[]{ "Latitude", "Longitude" }, null, null, null),
+ new pbr::GeneratedCodeInfo(typeof(global::Examples.Rectangle), new[]{ "Lo", "Hi" }, null, null, null),
+ new pbr::GeneratedCodeInfo(typeof(global::Examples.Feature), new[]{ "Name", "Location" }, null, null, null),
+ new pbr::GeneratedCodeInfo(typeof(global::Examples.RouteNote), new[]{ "Location", "Message" }, null, null, null),
+ new pbr::GeneratedCodeInfo(typeof(global::Examples.RouteSummary), new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null)
+ }));
}
#endregion
@@ -89,1781 +54,719 @@ namespace examples {
}
#region Messages
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Point : pb::GeneratedMessage<Point, Point.Builder> {
- private Point() { }
- private static readonly Point defaultInstance = new Point().MakeReadOnly();
- private static readonly string[] _pointFieldNames = new string[] { "latitude", "longitude" };
- private static readonly uint[] _pointFieldTags = new uint[] { 8, 16 };
- public static Point DefaultInstance {
- get { return defaultInstance; }
+ public sealed partial class Point : pb::IMessage<Point> {
+ private static readonly pb::MessageParser<Point> _parser = new pb::MessageParser<Point>(() => new Point());
+ public static pb::MessageParser<Point> Parser { get { return _parser; } }
+
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Examples.Proto.RouteGuide.Descriptor.MessageTypes[0]; }
}
- public override Point DefaultInstanceForType {
- get { return DefaultInstance; }
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
}
- protected override Point ThisMessage {
- get { return this; }
+ public Point() {
+ OnConstruction();
}
- public static pbd::MessageDescriptor Descriptor {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_Point__Descriptor; }
+ partial void OnConstruction();
+
+ public Point(Point other) : this() {
+ latitude_ = other.latitude_;
+ longitude_ = other.longitude_;
}
- protected override pb::FieldAccess.FieldAccessorTable<Point, Point.Builder> InternalFieldAccessors {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_Point__FieldAccessorTable; }
+ public Point Clone() {
+ return new Point(this);
}
public const int LatitudeFieldNumber = 1;
- private bool hasLatitude;
private int latitude_;
- public bool HasLatitude {
- get { return hasLatitude; }
- }
public int Latitude {
get { return latitude_; }
+ set {
+ latitude_ = value;
+ }
}
public const int LongitudeFieldNumber = 2;
- private bool hasLongitude;
private int longitude_;
- public bool HasLongitude {
- get { return hasLongitude; }
- }
public int Longitude {
get { return longitude_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
+ set {
+ longitude_ = value;
}
}
- public override void WriteTo(pb::ICodedOutputStream output) {
- CalcSerializedSize();
- string[] field_names = _pointFieldNames;
- if (hasLatitude) {
- output.WriteInt32(1, field_names[0], Latitude);
- }
- if (hasLongitude) {
- output.WriteInt32(2, field_names[1], Longitude);
- }
- UnknownFields.WriteTo(output);
- }
-
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- return CalcSerializedSize();
- }
+ public override bool Equals(object other) {
+ return Equals(other as Point);
}
- private int CalcSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (hasLatitude) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, Latitude);
+ public bool Equals(Point other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
}
- if (hasLongitude) {
- size += pb::CodedOutputStream.ComputeInt32Size(2, Longitude);
+ if (ReferenceEquals(other, this)) {
+ return true;
}
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- public static Point ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static Point ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static Point ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static Point ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static Point ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static Point ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- public static Point ParseDelimitedFrom(global::System.IO.Stream input) {
- return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
- }
- public static Point ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
- }
- public static Point ParseFrom(pb::ICodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static Point ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- private Point MakeReadOnly() {
- return this;
+ if (Latitude != other.Latitude) return false;
+ if (Longitude != other.Longitude) return false;
+ return true;
}
- 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(Point prototype) {
- return new Builder(prototype);
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Latitude != 0) hash ^= Latitude.GetHashCode();
+ if (Longitude != 0) hash ^= Longitude.GetHashCode();
+ return hash;
}
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Builder : pb::GeneratedBuilder<Point, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
- public Builder() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- }
- internal Builder(Point cloneFrom) {
- result = cloneFrom;
- resultIsReadOnly = true;
- }
-
- private bool resultIsReadOnly;
- private Point result;
+ public override string ToString() {
+ return pb::JsonFormatter.Default.Format(this);
+ }
- private Point PrepareBuilder() {
- if (resultIsReadOnly) {
- Point original = result;
- result = new Point();
- resultIsReadOnly = false;
- MergeFrom(original);
- }
- return result;
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Latitude != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(Latitude);
}
-
- public override bool IsInitialized {
- get { return result.IsInitialized; }
- }
-
- protected override Point MessageBeingBuilt {
- get { return PrepareBuilder(); }
+ if (Longitude != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(Longitude);
}
+ }
- public override Builder Clear() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- return this;
+ public int CalculateSize() {
+ int size = 0;
+ if (Latitude != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Latitude);
}
-
- public override Builder Clone() {
- if (resultIsReadOnly) {
- return new Builder(result);
- } else {
- return new Builder().MergeFrom(result);
- }
- }
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::examples.Point.Descriptor; }
+ if (Longitude != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Longitude);
}
+ return size;
+ }
- public override Point DefaultInstanceForType {
- get { return global::examples.Point.DefaultInstance; }
+ public void MergeFrom(Point other) {
+ if (other == null) {
+ return;
}
-
- public override Point BuildPartial() {
- if (resultIsReadOnly) {
- return result;
- }
- resultIsReadOnly = true;
- return result.MakeReadOnly();
+ if (other.Latitude != 0) {
+ Latitude = other.Latitude;
}
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is Point) {
- return MergeFrom((Point) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
+ if (other.Longitude != 0) {
+ Longitude = other.Longitude;
}
+ }
- public override Builder MergeFrom(Point other) {
- if (other == global::examples.Point.DefaultInstance) return this;
- PrepareBuilder();
- if (other.HasLatitude) {
- Latitude = other.Latitude;
- }
- if (other.HasLongitude) {
- Longitude = other.Longitude;
- }
- 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(_pointFieldNames, field_name, global::System.StringComparer.Ordinal);
- if(field_ordinal >= 0)
- tag = _pointFieldTags[field_ordinal];
- else {
- if (unknownFields == null) {
- unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- }
- ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
- continue;
- }
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 8: {
+ Latitude = input.ReadInt32();
+ break;
}
- 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.hasLatitude = input.ReadInt32(ref result.latitude_);
- break;
- }
- case 16: {
- result.hasLongitude = input.ReadInt32(ref result.longitude_);
- break;
- }
+ case 16: {
+ Longitude = input.ReadInt32();
+ break;
}
}
-
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
- }
-
-
- public bool HasLatitude {
- get { return result.hasLatitude; }
- }
- public int Latitude {
- get { return result.Latitude; }
- set { SetLatitude(value); }
- }
- public Builder SetLatitude(int value) {
- PrepareBuilder();
- result.hasLatitude = true;
- result.latitude_ = value;
- return this;
- }
- public Builder ClearLatitude() {
- PrepareBuilder();
- result.hasLatitude = false;
- result.latitude_ = 0;
- return this;
- }
-
- public bool HasLongitude {
- get { return result.hasLongitude; }
- }
- public int Longitude {
- get { return result.Longitude; }
- set { SetLongitude(value); }
- }
- public Builder SetLongitude(int value) {
- PrepareBuilder();
- result.hasLongitude = true;
- result.longitude_ = value;
- return this;
- }
- public Builder ClearLongitude() {
- PrepareBuilder();
- result.hasLongitude = false;
- result.longitude_ = 0;
- return this;
}
}
- static Point() {
- object.ReferenceEquals(global::examples.Proto.RouteGuide.Descriptor, null);
- }
+
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Rectangle : pb::GeneratedMessage<Rectangle, Rectangle.Builder> {
- private Rectangle() { }
- private static readonly Rectangle defaultInstance = new Rectangle().MakeReadOnly();
- private static readonly string[] _rectangleFieldNames = new string[] { "hi", "lo" };
- private static readonly uint[] _rectangleFieldTags = new uint[] { 18, 10 };
- public static Rectangle DefaultInstance {
- get { return defaultInstance; }
- }
+ public sealed partial class Rectangle : pb::IMessage<Rectangle> {
+ private static readonly pb::MessageParser<Rectangle> _parser = new pb::MessageParser<Rectangle>(() => new Rectangle());
+ public static pb::MessageParser<Rectangle> Parser { get { return _parser; } }
- public override Rectangle DefaultInstanceForType {
- get { return DefaultInstance; }
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Examples.Proto.RouteGuide.Descriptor.MessageTypes[1]; }
}
- protected override Rectangle ThisMessage {
- get { return this; }
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
}
- public static pbd::MessageDescriptor Descriptor {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_Rectangle__Descriptor; }
+ public Rectangle() {
+ OnConstruction();
}
- protected override pb::FieldAccess.FieldAccessorTable<Rectangle, Rectangle.Builder> InternalFieldAccessors {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_Rectangle__FieldAccessorTable; }
- }
+ partial void OnConstruction();
- public const int LoFieldNumber = 1;
- private bool hasLo;
- private global::examples.Point lo_;
- public bool HasLo {
- get { return hasLo; }
- }
- public global::examples.Point Lo {
- get { return lo_ ?? global::examples.Point.DefaultInstance; }
+ public Rectangle(Rectangle other) : this() {
+ Lo = other.lo_ != null ? other.Lo.Clone() : null;
+ Hi = other.hi_ != null ? other.Hi.Clone() : null;
}
- public const int HiFieldNumber = 2;
- private bool hasHi;
- private global::examples.Point hi_;
- public bool HasHi {
- get { return hasHi; }
- }
- public global::examples.Point Hi {
- get { return hi_ ?? global::examples.Point.DefaultInstance; }
+ public Rectangle Clone() {
+ return new Rectangle(this);
}
- public override bool IsInitialized {
- get {
- return true;
+ public const int LoFieldNumber = 1;
+ private global::Examples.Point lo_;
+ public global::Examples.Point Lo {
+ get { return lo_; }
+ set {
+ lo_ = value;
}
}
- public override void WriteTo(pb::ICodedOutputStream output) {
- CalcSerializedSize();
- string[] field_names = _rectangleFieldNames;
- if (hasLo) {
- output.WriteMessage(1, field_names[1], Lo);
- }
- if (hasHi) {
- output.WriteMessage(2, field_names[0], Hi);
+ public const int HiFieldNumber = 2;
+ private global::Examples.Point hi_;
+ public global::Examples.Point Hi {
+ get { return hi_; }
+ set {
+ hi_ = value;
}
- UnknownFields.WriteTo(output);
}
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- return CalcSerializedSize();
- }
+ public override bool Equals(object other) {
+ return Equals(other as Rectangle);
}
- private int CalcSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (hasLo) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, Lo);
+ public bool Equals(Rectangle other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
}
- if (hasHi) {
- size += pb::CodedOutputStream.ComputeMessageSize(2, Hi);
+ if (ReferenceEquals(other, this)) {
+ return true;
}
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- public static Rectangle ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static Rectangle ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static Rectangle ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static Rectangle ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static Rectangle ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static Rectangle ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- public static Rectangle ParseDelimitedFrom(global::System.IO.Stream input) {
- return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
- }
- public static Rectangle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
- }
- public static Rectangle ParseFrom(pb::ICodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static Rectangle ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- private Rectangle MakeReadOnly() {
- return this;
+ if (!object.Equals(Lo, other.Lo)) return false;
+ if (!object.Equals(Hi, other.Hi)) return false;
+ return true;
}
- 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(Rectangle prototype) {
- return new Builder(prototype);
+ public override int GetHashCode() {
+ int hash = 1;
+ if (lo_ != null) hash ^= Lo.GetHashCode();
+ if (hi_ != null) hash ^= Hi.GetHashCode();
+ return hash;
}
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Builder : pb::GeneratedBuilder<Rectangle, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
- public Builder() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- }
- internal Builder(Rectangle cloneFrom) {
- result = cloneFrom;
- resultIsReadOnly = true;
- }
-
- private bool resultIsReadOnly;
- private Rectangle result;
-
- private Rectangle PrepareBuilder() {
- if (resultIsReadOnly) {
- Rectangle original = result;
- result = new Rectangle();
- resultIsReadOnly = false;
- MergeFrom(original);
- }
- return result;
- }
-
- public override bool IsInitialized {
- get { return result.IsInitialized; }
- }
+ public override string ToString() {
+ return pb::JsonFormatter.Default.Format(this);
+ }
- protected override Rectangle MessageBeingBuilt {
- get { return PrepareBuilder(); }
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (lo_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Lo);
}
-
- public override Builder Clear() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- return this;
+ if (hi_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Hi);
}
+ }
- public override Builder Clone() {
- if (resultIsReadOnly) {
- return new Builder(result);
- } else {
- return new Builder().MergeFrom(result);
- }
+ public int CalculateSize() {
+ int size = 0;
+ if (lo_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Lo);
}
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::examples.Rectangle.Descriptor; }
+ if (hi_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Hi);
}
+ return size;
+ }
- public override Rectangle DefaultInstanceForType {
- get { return global::examples.Rectangle.DefaultInstance; }
+ public void MergeFrom(Rectangle other) {
+ if (other == null) {
+ return;
}
-
- public override Rectangle BuildPartial() {
- if (resultIsReadOnly) {
- return result;
+ if (other.lo_ != null) {
+ if (lo_ == null) {
+ lo_ = new global::Examples.Point();
}
- resultIsReadOnly = true;
- return result.MakeReadOnly();
+ Lo.MergeFrom(other.Lo);
}
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is Rectangle) {
- return MergeFrom((Rectangle) other);
- } else {
- base.MergeFrom(other);
- return this;
+ if (other.hi_ != null) {
+ if (hi_ == null) {
+ hi_ = new global::Examples.Point();
}
+ Hi.MergeFrom(other.Hi);
}
+ }
- public override Builder MergeFrom(Rectangle other) {
- if (other == global::examples.Rectangle.DefaultInstance) return this;
- PrepareBuilder();
- if (other.HasLo) {
- MergeLo(other.Lo);
- }
- if (other.HasHi) {
- MergeHi(other.Hi);
- }
- 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(_rectangleFieldNames, field_name, global::System.StringComparer.Ordinal);
- if(field_ordinal >= 0)
- tag = _rectangleFieldTags[field_ordinal];
- else {
- if (unknownFields == null) {
- unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- }
- ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
- continue;
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 10: {
+ if (lo_ == null) {
+ lo_ = new global::Examples.Point();
}
+ input.ReadMessage(lo_);
+ break;
}
- 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::examples.Point.Builder subBuilder = global::examples.Point.CreateBuilder();
- if (result.hasLo) {
- subBuilder.MergeFrom(Lo);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- Lo = subBuilder.BuildPartial();
- break;
- }
- case 18: {
- global::examples.Point.Builder subBuilder = global::examples.Point.CreateBuilder();
- if (result.hasHi) {
- subBuilder.MergeFrom(Hi);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- Hi = subBuilder.BuildPartial();
- break;
+ case 18: {
+ if (hi_ == null) {
+ hi_ = new global::Examples.Point();
}
+ input.ReadMessage(hi_);
+ break;
}
}
-
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
- }
-
-
- public bool HasLo {
- get { return result.hasLo; }
- }
- public global::examples.Point Lo {
- get { return result.Lo; }
- set { SetLo(value); }
- }
- public Builder SetLo(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- result.hasLo = true;
- result.lo_ = value;
- return this;
- }
- public Builder SetLo(global::examples.Point.Builder builderForValue) {
- pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
- PrepareBuilder();
- result.hasLo = true;
- result.lo_ = builderForValue.Build();
- return this;
- }
- public Builder MergeLo(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- if (result.hasLo &&
- result.lo_ != global::examples.Point.DefaultInstance) {
- result.lo_ = global::examples.Point.CreateBuilder(result.lo_).MergeFrom(value).BuildPartial();
- } else {
- result.lo_ = value;
- }
- result.hasLo = true;
- return this;
- }
- public Builder ClearLo() {
- PrepareBuilder();
- result.hasLo = false;
- result.lo_ = null;
- return this;
- }
-
- public bool HasHi {
- get { return result.hasHi; }
- }
- public global::examples.Point Hi {
- get { return result.Hi; }
- set { SetHi(value); }
- }
- public Builder SetHi(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- result.hasHi = true;
- result.hi_ = value;
- return this;
- }
- public Builder SetHi(global::examples.Point.Builder builderForValue) {
- pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
- PrepareBuilder();
- result.hasHi = true;
- result.hi_ = builderForValue.Build();
- return this;
- }
- public Builder MergeHi(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- if (result.hasHi &&
- result.hi_ != global::examples.Point.DefaultInstance) {
- result.hi_ = global::examples.Point.CreateBuilder(result.hi_).MergeFrom(value).BuildPartial();
- } else {
- result.hi_ = value;
- }
- result.hasHi = true;
- return this;
}
- public Builder ClearHi() {
- PrepareBuilder();
- result.hasHi = false;
- result.hi_ = null;
- return this;
- }
- }
- static Rectangle() {
- object.ReferenceEquals(global::examples.Proto.RouteGuide.Descriptor, null);
}
+
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Feature : pb::GeneratedMessage<Feature, Feature.Builder> {
- private Feature() { }
- private static readonly Feature defaultInstance = new Feature().MakeReadOnly();
- private static readonly string[] _featureFieldNames = new string[] { "location", "name" };
- private static readonly uint[] _featureFieldTags = new uint[] { 18, 10 };
- public static Feature DefaultInstance {
- get { return defaultInstance; }
+ public sealed partial class Feature : pb::IMessage<Feature> {
+ private static readonly pb::MessageParser<Feature> _parser = new pb::MessageParser<Feature>(() => new Feature());
+ public static pb::MessageParser<Feature> Parser { get { return _parser; } }
+
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Examples.Proto.RouteGuide.Descriptor.MessageTypes[2]; }
}
- public override Feature DefaultInstanceForType {
- get { return DefaultInstance; }
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
}
- protected override Feature ThisMessage {
- get { return this; }
+ public Feature() {
+ OnConstruction();
}
- public static pbd::MessageDescriptor Descriptor {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_Feature__Descriptor; }
+ partial void OnConstruction();
+
+ public Feature(Feature other) : this() {
+ name_ = other.name_;
+ Location = other.location_ != null ? other.Location.Clone() : null;
}
- protected override pb::FieldAccess.FieldAccessorTable<Feature, Feature.Builder> InternalFieldAccessors {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_Feature__FieldAccessorTable; }
+ public Feature Clone() {
+ return new Feature(this);
}
public const int NameFieldNumber = 1;
- private bool hasName;
private string name_ = "";
- public bool HasName {
- get { return hasName; }
- }
public string Name {
get { return name_; }
- }
-
- public const int LocationFieldNumber = 2;
- private bool hasLocation;
- private global::examples.Point location_;
- public bool HasLocation {
- get { return hasLocation; }
- }
- public global::examples.Point Location {
- get { return location_ ?? global::examples.Point.DefaultInstance; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
+ set {
+ name_ = pb::Preconditions.CheckNotNull(value, "value");
}
}
- public override void WriteTo(pb::ICodedOutputStream output) {
- CalcSerializedSize();
- string[] field_names = _featureFieldNames;
- if (hasName) {
- output.WriteString(1, field_names[1], Name);
- }
- if (hasLocation) {
- output.WriteMessage(2, field_names[0], Location);
+ public const int LocationFieldNumber = 2;
+ private global::Examples.Point location_;
+ public global::Examples.Point Location {
+ get { return location_; }
+ set {
+ location_ = value;
}
- UnknownFields.WriteTo(output);
}
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- return CalcSerializedSize();
- }
+ public override bool Equals(object other) {
+ return Equals(other as Feature);
}
- private int CalcSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (hasName) {
- size += pb::CodedOutputStream.ComputeStringSize(1, Name);
+ public bool Equals(Feature other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
}
- if (hasLocation) {
- size += pb::CodedOutputStream.ComputeMessageSize(2, Location);
+ if (ReferenceEquals(other, this)) {
+ return true;
}
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- public static Feature ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static Feature ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static Feature ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static Feature ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static Feature ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static Feature ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- public static Feature ParseDelimitedFrom(global::System.IO.Stream input) {
- return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
- }
- public static Feature ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
- }
- public static Feature ParseFrom(pb::ICodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static Feature ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- private Feature MakeReadOnly() {
- return this;
+ if (Name != other.Name) return false;
+ if (!object.Equals(Location, other.Location)) return false;
+ return true;
}
- 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(Feature prototype) {
- return new Builder(prototype);
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Name.Length != 0) hash ^= Name.GetHashCode();
+ if (location_ != null) hash ^= Location.GetHashCode();
+ return hash;
}
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Builder : pb::GeneratedBuilder<Feature, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
- public Builder() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- }
- internal Builder(Feature cloneFrom) {
- result = cloneFrom;
- resultIsReadOnly = true;
- }
-
- private bool resultIsReadOnly;
- private Feature result;
-
- private Feature PrepareBuilder() {
- if (resultIsReadOnly) {
- Feature original = result;
- result = new Feature();
- resultIsReadOnly = false;
- MergeFrom(original);
- }
- return result;
- }
-
- public override bool IsInitialized {
- get { return result.IsInitialized; }
- }
+ public override string ToString() {
+ return pb::JsonFormatter.Default.Format(this);
+ }
- protected override Feature MessageBeingBuilt {
- get { return PrepareBuilder(); }
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Name.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Name);
}
-
- public override Builder Clear() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- return this;
+ if (location_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Location);
}
+ }
- public override Builder Clone() {
- if (resultIsReadOnly) {
- return new Builder(result);
- } else {
- return new Builder().MergeFrom(result);
- }
+ public int CalculateSize() {
+ int size = 0;
+ if (Name.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::examples.Feature.Descriptor; }
+ if (location_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Location);
}
+ return size;
+ }
- public override Feature DefaultInstanceForType {
- get { return global::examples.Feature.DefaultInstance; }
+ public void MergeFrom(Feature other) {
+ if (other == null) {
+ return;
}
-
- public override Feature BuildPartial() {
- if (resultIsReadOnly) {
- return result;
- }
- resultIsReadOnly = true;
- return result.MakeReadOnly();
+ if (other.Name.Length != 0) {
+ Name = other.Name;
}
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is Feature) {
- return MergeFrom((Feature) other);
- } else {
- base.MergeFrom(other);
- return this;
+ if (other.location_ != null) {
+ if (location_ == null) {
+ location_ = new global::Examples.Point();
}
+ Location.MergeFrom(other.Location);
}
+ }
- public override Builder MergeFrom(Feature other) {
- if (other == global::examples.Feature.DefaultInstance) return this;
- PrepareBuilder();
- if (other.HasName) {
- Name = other.Name;
- }
- if (other.HasLocation) {
- MergeLocation(other.Location);
- }
- 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(_featureFieldNames, field_name, global::System.StringComparer.Ordinal);
- if(field_ordinal >= 0)
- tag = _featureFieldTags[field_ordinal];
- else {
- if (unknownFields == null) {
- unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- }
- ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
- continue;
- }
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 10: {
+ Name = input.ReadString();
+ break;
}
- 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.hasName = input.ReadString(ref result.name_);
- break;
- }
- case 18: {
- global::examples.Point.Builder subBuilder = global::examples.Point.CreateBuilder();
- if (result.hasLocation) {
- subBuilder.MergeFrom(Location);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- Location = subBuilder.BuildPartial();
- break;
+ case 18: {
+ if (location_ == null) {
+ location_ = new global::Examples.Point();
}
+ input.ReadMessage(location_);
+ break;
}
}
-
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
- }
-
-
- public bool HasName {
- get { return result.hasName; }
- }
- public string Name {
- get { return result.Name; }
- set { SetName(value); }
- }
- public Builder SetName(string value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- result.hasName = true;
- result.name_ = value;
- return this;
- }
- public Builder ClearName() {
- PrepareBuilder();
- result.hasName = false;
- result.name_ = "";
- return this;
- }
-
- public bool HasLocation {
- get { return result.hasLocation; }
- }
- public global::examples.Point Location {
- get { return result.Location; }
- set { SetLocation(value); }
- }
- public Builder SetLocation(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- result.hasLocation = true;
- result.location_ = value;
- return this;
- }
- public Builder SetLocation(global::examples.Point.Builder builderForValue) {
- pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
- PrepareBuilder();
- result.hasLocation = true;
- result.location_ = builderForValue.Build();
- return this;
- }
- public Builder MergeLocation(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- if (result.hasLocation &&
- result.location_ != global::examples.Point.DefaultInstance) {
- result.location_ = global::examples.Point.CreateBuilder(result.location_).MergeFrom(value).BuildPartial();
- } else {
- result.location_ = value;
- }
- result.hasLocation = true;
- return this;
- }
- public Builder ClearLocation() {
- PrepareBuilder();
- result.hasLocation = false;
- result.location_ = null;
- return this;
}
}
- static Feature() {
- object.ReferenceEquals(global::examples.Proto.RouteGuide.Descriptor, null);
- }
+
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class RouteNote : pb::GeneratedMessage<RouteNote, RouteNote.Builder> {
- private RouteNote() { }
- private static readonly RouteNote defaultInstance = new RouteNote().MakeReadOnly();
- private static readonly string[] _routeNoteFieldNames = new string[] { "location", "message" };
- private static readonly uint[] _routeNoteFieldTags = new uint[] { 10, 18 };
- public static RouteNote DefaultInstance {
- get { return defaultInstance; }
+ public sealed partial class RouteNote : pb::IMessage<RouteNote> {
+ private static readonly pb::MessageParser<RouteNote> _parser = new pb::MessageParser<RouteNote>(() => new RouteNote());
+ public static pb::MessageParser<RouteNote> Parser { get { return _parser; } }
+
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Examples.Proto.RouteGuide.Descriptor.MessageTypes[3]; }
}
- public override RouteNote DefaultInstanceForType {
- get { return DefaultInstance; }
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
}
- protected override RouteNote ThisMessage {
- get { return this; }
+ public RouteNote() {
+ OnConstruction();
}
- public static pbd::MessageDescriptor Descriptor {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_RouteNote__Descriptor; }
+ partial void OnConstruction();
+
+ public RouteNote(RouteNote other) : this() {
+ Location = other.location_ != null ? other.Location.Clone() : null;
+ message_ = other.message_;
}
- protected override pb::FieldAccess.FieldAccessorTable<RouteNote, RouteNote.Builder> InternalFieldAccessors {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_RouteNote__FieldAccessorTable; }
+ public RouteNote Clone() {
+ return new RouteNote(this);
}
public const int LocationFieldNumber = 1;
- private bool hasLocation;
- private global::examples.Point location_;
- public bool HasLocation {
- get { return hasLocation; }
- }
- public global::examples.Point Location {
- get { return location_ ?? global::examples.Point.DefaultInstance; }
+ private global::Examples.Point location_;
+ public global::Examples.Point Location {
+ get { return location_; }
+ set {
+ location_ = value;
+ }
}
public const int MessageFieldNumber = 2;
- private bool hasMessage;
private string message_ = "";
- public bool HasMessage {
- get { return hasMessage; }
- }
public string Message {
get { return message_; }
- }
-
- public override bool IsInitialized {
- get {
- return true;
+ set {
+ message_ = pb::Preconditions.CheckNotNull(value, "value");
}
}
- public override void WriteTo(pb::ICodedOutputStream output) {
- CalcSerializedSize();
- string[] field_names = _routeNoteFieldNames;
- if (hasLocation) {
- output.WriteMessage(1, field_names[0], Location);
- }
- if (hasMessage) {
- output.WriteString(2, field_names[1], Message);
- }
- UnknownFields.WriteTo(output);
+ public override bool Equals(object other) {
+ return Equals(other as RouteNote);
}
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- return CalcSerializedSize();
+ public bool Equals(RouteNote other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
}
- }
-
- private int CalcSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
-
- size = 0;
- if (hasLocation) {
- size += pb::CodedOutputStream.ComputeMessageSize(1, Location);
- }
- if (hasMessage) {
- size += pb::CodedOutputStream.ComputeStringSize(2, Message);
+ if (ReferenceEquals(other, this)) {
+ return true;
}
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- public static RouteNote ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static RouteNote ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static RouteNote ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static RouteNote ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static RouteNote ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static RouteNote ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- public static RouteNote ParseDelimitedFrom(global::System.IO.Stream input) {
- return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
- }
- public static RouteNote ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
- }
- public static RouteNote ParseFrom(pb::ICodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static RouteNote ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- private RouteNote MakeReadOnly() {
- return this;
+ if (!object.Equals(Location, other.Location)) return false;
+ if (Message != other.Message) return false;
+ return true;
}
- 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(RouteNote prototype) {
- return new Builder(prototype);
+ public override int GetHashCode() {
+ int hash = 1;
+ if (location_ != null) hash ^= Location.GetHashCode();
+ if (Message.Length != 0) hash ^= Message.GetHashCode();
+ return hash;
}
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Builder : pb::GeneratedBuilder<RouteNote, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
- }
- public Builder() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- }
- internal Builder(RouteNote cloneFrom) {
- result = cloneFrom;
- resultIsReadOnly = true;
- }
-
- private bool resultIsReadOnly;
- private RouteNote result;
-
- private RouteNote PrepareBuilder() {
- if (resultIsReadOnly) {
- RouteNote original = result;
- result = new RouteNote();
- resultIsReadOnly = false;
- MergeFrom(original);
- }
- return result;
- }
-
- public override bool IsInitialized {
- get { return result.IsInitialized; }
- }
+ public override string ToString() {
+ return pb::JsonFormatter.Default.Format(this);
+ }
- protected override RouteNote MessageBeingBuilt {
- get { return PrepareBuilder(); }
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (location_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Location);
}
-
- public override Builder Clear() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- return this;
+ if (Message.Length != 0) {
+ output.WriteRawTag(18);
+ output.WriteString(Message);
}
+ }
- public override Builder Clone() {
- if (resultIsReadOnly) {
- return new Builder(result);
- } else {
- return new Builder().MergeFrom(result);
- }
+ public int CalculateSize() {
+ int size = 0;
+ if (location_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Location);
}
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::examples.RouteNote.Descriptor; }
+ if (Message.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Message);
}
+ return size;
+ }
- public override RouteNote DefaultInstanceForType {
- get { return global::examples.RouteNote.DefaultInstance; }
+ public void MergeFrom(RouteNote other) {
+ if (other == null) {
+ return;
}
-
- public override RouteNote BuildPartial() {
- if (resultIsReadOnly) {
- return result;
+ if (other.location_ != null) {
+ if (location_ == null) {
+ location_ = new global::Examples.Point();
}
- resultIsReadOnly = true;
- return result.MakeReadOnly();
+ Location.MergeFrom(other.Location);
}
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is RouteNote) {
- return MergeFrom((RouteNote) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
+ if (other.Message.Length != 0) {
+ Message = other.Message;
}
+ }
- public override Builder MergeFrom(RouteNote other) {
- if (other == global::examples.RouteNote.DefaultInstance) return this;
- PrepareBuilder();
- if (other.HasLocation) {
- MergeLocation(other.Location);
- }
- if (other.HasMessage) {
- Message = other.Message;
- }
- 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(_routeNoteFieldNames, field_name, global::System.StringComparer.Ordinal);
- if(field_ordinal >= 0)
- tag = _routeNoteFieldTags[field_ordinal];
- else {
- if (unknownFields == null) {
- unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- }
- ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
- continue;
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 10: {
+ if (location_ == null) {
+ location_ = new global::Examples.Point();
}
+ input.ReadMessage(location_);
+ break;
}
- 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::examples.Point.Builder subBuilder = global::examples.Point.CreateBuilder();
- if (result.hasLocation) {
- subBuilder.MergeFrom(Location);
- }
- input.ReadMessage(subBuilder, extensionRegistry);
- Location = subBuilder.BuildPartial();
- break;
- }
- case 18: {
- result.hasMessage = input.ReadString(ref result.message_);
- break;
- }
+ case 18: {
+ Message = input.ReadString();
+ break;
}
}
-
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
- }
-
-
- public bool HasLocation {
- get { return result.hasLocation; }
- }
- public global::examples.Point Location {
- get { return result.Location; }
- set { SetLocation(value); }
- }
- public Builder SetLocation(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- result.hasLocation = true;
- result.location_ = value;
- return this;
- }
- public Builder SetLocation(global::examples.Point.Builder builderForValue) {
- pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
- PrepareBuilder();
- result.hasLocation = true;
- result.location_ = builderForValue.Build();
- return this;
- }
- public Builder MergeLocation(global::examples.Point value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- if (result.hasLocation &&
- result.location_ != global::examples.Point.DefaultInstance) {
- result.location_ = global::examples.Point.CreateBuilder(result.location_).MergeFrom(value).BuildPartial();
- } else {
- result.location_ = value;
- }
- result.hasLocation = true;
- return this;
- }
- public Builder ClearLocation() {
- PrepareBuilder();
- result.hasLocation = false;
- result.location_ = null;
- return this;
- }
-
- public bool HasMessage {
- get { return result.hasMessage; }
- }
- public string Message {
- get { return result.Message; }
- set { SetMessage(value); }
- }
- public Builder SetMessage(string value) {
- pb::ThrowHelper.ThrowIfNull(value, "value");
- PrepareBuilder();
- result.hasMessage = true;
- result.message_ = value;
- return this;
- }
- public Builder ClearMessage() {
- PrepareBuilder();
- result.hasMessage = false;
- result.message_ = "";
- return this;
}
}
- static RouteNote() {
- object.ReferenceEquals(global::examples.Proto.RouteGuide.Descriptor, null);
- }
+
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class RouteSummary : pb::GeneratedMessage<RouteSummary, RouteSummary.Builder> {
- private RouteSummary() { }
- private static readonly RouteSummary defaultInstance = new RouteSummary().MakeReadOnly();
- private static readonly string[] _routeSummaryFieldNames = new string[] { "distance", "elapsed_time", "feature_count", "point_count" };
- private static readonly uint[] _routeSummaryFieldTags = new uint[] { 24, 32, 16, 8 };
- public static RouteSummary DefaultInstance {
- get { return defaultInstance; }
+ public sealed partial class RouteSummary : pb::IMessage<RouteSummary> {
+ private static readonly pb::MessageParser<RouteSummary> _parser = new pb::MessageParser<RouteSummary>(() => new RouteSummary());
+ public static pb::MessageParser<RouteSummary> Parser { get { return _parser; } }
+
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Examples.Proto.RouteGuide.Descriptor.MessageTypes[4]; }
}
- public override RouteSummary DefaultInstanceForType {
- get { return DefaultInstance; }
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
}
- protected override RouteSummary ThisMessage {
- get { return this; }
+ public RouteSummary() {
+ OnConstruction();
}
- public static pbd::MessageDescriptor Descriptor {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_RouteSummary__Descriptor; }
+ partial void OnConstruction();
+
+ public RouteSummary(RouteSummary other) : this() {
+ pointCount_ = other.pointCount_;
+ featureCount_ = other.featureCount_;
+ distance_ = other.distance_;
+ elapsedTime_ = other.elapsedTime_;
}
- protected override pb::FieldAccess.FieldAccessorTable<RouteSummary, RouteSummary.Builder> InternalFieldAccessors {
- get { return global::examples.Proto.RouteGuide.internal__static_examples_RouteSummary__FieldAccessorTable; }
+ public RouteSummary Clone() {
+ return new RouteSummary(this);
}
public const int PointCountFieldNumber = 1;
- private bool hasPointCount;
private int pointCount_;
- public bool HasPointCount {
- get { return hasPointCount; }
- }
public int PointCount {
get { return pointCount_; }
+ set {
+ pointCount_ = value;
+ }
}
public const int FeatureCountFieldNumber = 2;
- private bool hasFeatureCount;
private int featureCount_;
- public bool HasFeatureCount {
- get { return hasFeatureCount; }
- }
public int FeatureCount {
get { return featureCount_; }
+ set {
+ featureCount_ = value;
+ }
}
public const int DistanceFieldNumber = 3;
- private bool hasDistance;
private int distance_;
- public bool HasDistance {
- get { return hasDistance; }
- }
public int Distance {
get { return distance_; }
+ set {
+ distance_ = value;
+ }
}
public const int ElapsedTimeFieldNumber = 4;
- private bool hasElapsedTime;
private int elapsedTime_;
- public bool HasElapsedTime {
- get { return hasElapsedTime; }
- }
public int ElapsedTime {
get { return elapsedTime_; }
+ set {
+ elapsedTime_ = value;
+ }
}
- public override bool IsInitialized {
- get {
- return true;
- }
+ public override bool Equals(object other) {
+ return Equals(other as RouteSummary);
}
- public override void WriteTo(pb::ICodedOutputStream output) {
- CalcSerializedSize();
- string[] field_names = _routeSummaryFieldNames;
- if (hasPointCount) {
- output.WriteInt32(1, field_names[3], PointCount);
- }
- if (hasFeatureCount) {
- output.WriteInt32(2, field_names[2], FeatureCount);
- }
- if (hasDistance) {
- output.WriteInt32(3, field_names[0], Distance);
+ public bool Equals(RouteSummary other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
}
- if (hasElapsedTime) {
- output.WriteInt32(4, field_names[1], ElapsedTime);
+ if (ReferenceEquals(other, this)) {
+ return true;
}
- UnknownFields.WriteTo(output);
+ if (PointCount != other.PointCount) return false;
+ if (FeatureCount != other.FeatureCount) return false;
+ if (Distance != other.Distance) return false;
+ if (ElapsedTime != other.ElapsedTime) return false;
+ return true;
}
- private int memoizedSerializedSize = -1;
- public override int SerializedSize {
- get {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
- return CalcSerializedSize();
- }
+ public override int GetHashCode() {
+ int hash = 1;
+ if (PointCount != 0) hash ^= PointCount.GetHashCode();
+ if (FeatureCount != 0) hash ^= FeatureCount.GetHashCode();
+ if (Distance != 0) hash ^= Distance.GetHashCode();
+ if (ElapsedTime != 0) hash ^= ElapsedTime.GetHashCode();
+ return hash;
}
- private int CalcSerializedSize() {
- int size = memoizedSerializedSize;
- if (size != -1) return size;
+ public override string ToString() {
+ return pb::JsonFormatter.Default.Format(this);
+ }
- size = 0;
- if (hasPointCount) {
- size += pb::CodedOutputStream.ComputeInt32Size(1, PointCount);
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (PointCount != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(PointCount);
}
- if (hasFeatureCount) {
- size += pb::CodedOutputStream.ComputeInt32Size(2, FeatureCount);
+ if (FeatureCount != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(FeatureCount);
}
- if (hasDistance) {
- size += pb::CodedOutputStream.ComputeInt32Size(3, Distance);
+ if (Distance != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(Distance);
}
- if (hasElapsedTime) {
- size += pb::CodedOutputStream.ComputeInt32Size(4, ElapsedTime);
+ if (ElapsedTime != 0) {
+ output.WriteRawTag(32);
+ output.WriteInt32(ElapsedTime);
}
- size += UnknownFields.SerializedSize;
- memoizedSerializedSize = size;
- return size;
- }
- public static RouteSummary ParseFrom(pb::ByteString data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static RouteSummary ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static RouteSummary ParseFrom(byte[] data) {
- return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
- }
- public static RouteSummary ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
- }
- public static RouteSummary ParseFrom(global::System.IO.Stream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static RouteSummary ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- public static RouteSummary ParseDelimitedFrom(global::System.IO.Stream input) {
- return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
- }
- public static RouteSummary ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
- return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
- }
- public static RouteSummary ParseFrom(pb::ICodedInputStream input) {
- return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
- }
- public static RouteSummary ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
- return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
- }
- private RouteSummary 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(RouteSummary prototype) {
- return new Builder(prototype);
}
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- public sealed partial class Builder : pb::GeneratedBuilder<RouteSummary, Builder> {
- protected override Builder ThisBuilder {
- get { return this; }
+ public int CalculateSize() {
+ int size = 0;
+ if (PointCount != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(PointCount);
}
- public Builder() {
- result = DefaultInstance;
- resultIsReadOnly = true;
+ if (FeatureCount != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(FeatureCount);
}
- internal Builder(RouteSummary cloneFrom) {
- result = cloneFrom;
- resultIsReadOnly = true;
+ if (Distance != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Distance);
}
-
- private bool resultIsReadOnly;
- private RouteSummary result;
-
- private RouteSummary PrepareBuilder() {
- if (resultIsReadOnly) {
- RouteSummary original = result;
- result = new RouteSummary();
- resultIsReadOnly = false;
- MergeFrom(original);
- }
- return result;
- }
-
- public override bool IsInitialized {
- get { return result.IsInitialized; }
- }
-
- protected override RouteSummary MessageBeingBuilt {
- get { return PrepareBuilder(); }
- }
-
- public override Builder Clear() {
- result = DefaultInstance;
- resultIsReadOnly = true;
- return this;
+ if (ElapsedTime != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(ElapsedTime);
}
+ return size;
+ }
- public override Builder Clone() {
- if (resultIsReadOnly) {
- return new Builder(result);
- } else {
- return new Builder().MergeFrom(result);
- }
+ public void MergeFrom(RouteSummary other) {
+ if (other == null) {
+ return;
}
-
- public override pbd::MessageDescriptor DescriptorForType {
- get { return global::examples.RouteSummary.Descriptor; }
+ if (other.PointCount != 0) {
+ PointCount = other.PointCount;
}
-
- public override RouteSummary DefaultInstanceForType {
- get { return global::examples.RouteSummary.DefaultInstance; }
+ if (other.FeatureCount != 0) {
+ FeatureCount = other.FeatureCount;
}
-
- public override RouteSummary BuildPartial() {
- if (resultIsReadOnly) {
- return result;
- }
- resultIsReadOnly = true;
- return result.MakeReadOnly();
+ if (other.Distance != 0) {
+ Distance = other.Distance;
}
-
- public override Builder MergeFrom(pb::IMessage other) {
- if (other is RouteSummary) {
- return MergeFrom((RouteSummary) other);
- } else {
- base.MergeFrom(other);
- return this;
- }
+ if (other.ElapsedTime != 0) {
+ ElapsedTime = other.ElapsedTime;
}
+ }
- public override Builder MergeFrom(RouteSummary other) {
- if (other == global::examples.RouteSummary.DefaultInstance) return this;
- PrepareBuilder();
- if (other.HasPointCount) {
- PointCount = other.PointCount;
- }
- if (other.HasFeatureCount) {
- FeatureCount = other.FeatureCount;
- }
- if (other.HasDistance) {
- Distance = other.Distance;
- }
- if (other.HasElapsedTime) {
- ElapsedTime = other.ElapsedTime;
- }
- 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(_routeSummaryFieldNames, field_name, global::System.StringComparer.Ordinal);
- if(field_ordinal >= 0)
- tag = _routeSummaryFieldTags[field_ordinal];
- else {
- if (unknownFields == null) {
- unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
- }
- ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
- continue;
- }
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ input.SkipLastField();
+ break;
+ case 8: {
+ PointCount = input.ReadInt32();
+ break;
}
- 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.hasPointCount = input.ReadInt32(ref result.pointCount_);
- break;
- }
- case 16: {
- result.hasFeatureCount = input.ReadInt32(ref result.featureCount_);
- break;
- }
- case 24: {
- result.hasDistance = input.ReadInt32(ref result.distance_);
- break;
- }
- case 32: {
- result.hasElapsedTime = input.ReadInt32(ref result.elapsedTime_);
- break;
- }
+ case 16: {
+ FeatureCount = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ Distance = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ ElapsedTime = input.ReadInt32();
+ break;
}
}
-
- if (unknownFields != null) {
- this.UnknownFields = unknownFields.Build();
- }
- return this;
- }
-
-
- public bool HasPointCount {
- get { return result.hasPointCount; }
- }
- public int PointCount {
- get { return result.PointCount; }
- set { SetPointCount(value); }
- }
- public Builder SetPointCount(int value) {
- PrepareBuilder();
- result.hasPointCount = true;
- result.pointCount_ = value;
- return this;
- }
- public Builder ClearPointCount() {
- PrepareBuilder();
- result.hasPointCount = false;
- result.pointCount_ = 0;
- return this;
- }
-
- public bool HasFeatureCount {
- get { return result.hasFeatureCount; }
- }
- public int FeatureCount {
- get { return result.FeatureCount; }
- set { SetFeatureCount(value); }
- }
- public Builder SetFeatureCount(int value) {
- PrepareBuilder();
- result.hasFeatureCount = true;
- result.featureCount_ = value;
- return this;
- }
- public Builder ClearFeatureCount() {
- PrepareBuilder();
- result.hasFeatureCount = false;
- result.featureCount_ = 0;
- return this;
- }
-
- public bool HasDistance {
- get { return result.hasDistance; }
- }
- public int Distance {
- get { return result.Distance; }
- set { SetDistance(value); }
- }
- public Builder SetDistance(int value) {
- PrepareBuilder();
- result.hasDistance = true;
- result.distance_ = value;
- return this;
- }
- public Builder ClearDistance() {
- PrepareBuilder();
- result.hasDistance = false;
- result.distance_ = 0;
- return this;
- }
-
- public bool HasElapsedTime {
- get { return result.hasElapsedTime; }
- }
- public int ElapsedTime {
- get { return result.ElapsedTime; }
- set { SetElapsedTime(value); }
- }
- public Builder SetElapsedTime(int value) {
- PrepareBuilder();
- result.hasElapsedTime = true;
- result.elapsedTime_ = value;
- return this;
- }
- public Builder ClearElapsedTime() {
- PrepareBuilder();
- result.hasElapsedTime = false;
- result.elapsedTime_ = 0;
- return this;
}
}
- static RouteSummary() {
- object.ReferenceEquals(global::examples.Proto.RouteGuide.Descriptor, null);
- }
+
}
#endregion
diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj
index 8358974aac..9541b5fc07 100644
--- a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj
+++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props" Condition="Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props')" />
+ <Import Project="..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props" Condition="Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props')" />
<Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props')" />
<Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.props" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -14,7 +14,7 @@
<AssemblyName>RouteGuide</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
- <NuGetPackageImportStamp>214cccda</NuGetPackageImportStamp>
+ <NuGetPackageImportStamp>0c81069d</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -34,25 +34,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Google.ProtocolBuffers">
- <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll</HintPath>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference>
- <Reference Include="Google.ProtocolBuffers.Serialization">
- <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
- </Reference>
- <Reference Include="Grpc.Core, Version=0.6.5668.37363, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Grpc.Core.0.6.0\lib\net45\Grpc.Core.dll</HintPath>
+ <Reference Include="Grpc.Core">
+ <HintPath>..\packages\Grpc.Core.0.7.0-preview20150827\lib\net45\Grpc.Core.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.7.0.1-beta2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
- <Reference Include="System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
- </Reference>
<Reference Include="System.Core" />
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
@@ -71,7 +63,6 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
- <None Include="protos\route_guide.proto" />
<None Include="route_guide_db.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -85,12 +76,12 @@
<Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets'))" />
<Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props'))" />
<Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets'))" />
- <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props'))" />
- <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets'))" />
+ <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props'))" />
+ <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets'))" />
</Target>
<Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets')" />
<Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets')" />
- <Import Project="..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets" Condition="Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets')" />
+ <Import Project="..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets" Condition="Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
index c4b3900dca..f2dc1c2ec0 100644
--- a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
+++ b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
@@ -7,93 +7,130 @@ using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
-namespace examples {
+namespace Examples {
public static class RouteGuide
{
static readonly string __ServiceName = "examples.RouteGuide";
- static readonly Marshaller<global::examples.Point> __Marshaller_Point = Marshallers.Create((arg) => arg.ToByteArray(), global::examples.Point.ParseFrom);
- static readonly Marshaller<global::examples.Feature> __Marshaller_Feature = Marshallers.Create((arg) => arg.ToByteArray(), global::examples.Feature.ParseFrom);
- static readonly Marshaller<global::examples.Rectangle> __Marshaller_Rectangle = Marshallers.Create((arg) => arg.ToByteArray(), global::examples.Rectangle.ParseFrom);
- static readonly Marshaller<global::examples.RouteSummary> __Marshaller_RouteSummary = Marshallers.Create((arg) => arg.ToByteArray(), global::examples.RouteSummary.ParseFrom);
- static readonly Marshaller<global::examples.RouteNote> __Marshaller_RouteNote = Marshallers.Create((arg) => arg.ToByteArray(), global::examples.RouteNote.ParseFrom);
+ static readonly Marshaller<global::Examples.Point> __Marshaller_Point = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.Point.Parser.ParseFrom);
+ static readonly Marshaller<global::Examples.Feature> __Marshaller_Feature = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.Feature.Parser.ParseFrom);
+ static readonly Marshaller<global::Examples.Rectangle> __Marshaller_Rectangle = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.Rectangle.Parser.ParseFrom);
+ static readonly Marshaller<global::Examples.RouteSummary> __Marshaller_RouteSummary = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.RouteSummary.Parser.ParseFrom);
+ static readonly Marshaller<global::Examples.RouteNote> __Marshaller_RouteNote = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.RouteNote.Parser.ParseFrom);
- static readonly Method<global::examples.Point, global::examples.Feature> __Method_GetFeature = new Method<global::examples.Point, global::examples.Feature>(
+ static readonly Method<global::Examples.Point, global::Examples.Feature> __Method_GetFeature = new Method<global::Examples.Point, global::Examples.Feature>(
MethodType.Unary,
+ __ServiceName,
"GetFeature",
__Marshaller_Point,
__Marshaller_Feature);
- static readonly Method<global::examples.Rectangle, global::examples.Feature> __Method_ListFeatures = new Method<global::examples.Rectangle, global::examples.Feature>(
+ static readonly Method<global::Examples.Rectangle, global::Examples.Feature> __Method_ListFeatures = new Method<global::Examples.Rectangle, global::Examples.Feature>(
MethodType.ServerStreaming,
+ __ServiceName,
"ListFeatures",
__Marshaller_Rectangle,
__Marshaller_Feature);
- static readonly Method<global::examples.Point, global::examples.RouteSummary> __Method_RecordRoute = new Method<global::examples.Point, global::examples.RouteSummary>(
+ static readonly Method<global::Examples.Point, global::Examples.RouteSummary> __Method_RecordRoute = new Method<global::Examples.Point, global::Examples.RouteSummary>(
MethodType.ClientStreaming,
+ __ServiceName,
"RecordRoute",
__Marshaller_Point,
__Marshaller_RouteSummary);
- static readonly Method<global::examples.RouteNote, global::examples.RouteNote> __Method_RouteChat = new Method<global::examples.RouteNote, global::examples.RouteNote>(
+ static readonly Method<global::Examples.RouteNote, global::Examples.RouteNote> __Method_RouteChat = new Method<global::Examples.RouteNote, global::Examples.RouteNote>(
MethodType.DuplexStreaming,
+ __ServiceName,
"RouteChat",
__Marshaller_RouteNote,
__Marshaller_RouteNote);
- // client-side stub interface
+ // service descriptor
+ public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
+ {
+ get { return global::Examples.Proto.RouteGuide.Descriptor.Services[0]; }
+ }
+
+ // client interface
public interface IRouteGuideClient
{
- global::examples.Feature GetFeature(global::examples.Point request, CancellationToken token = default(CancellationToken));
- Task<global::examples.Feature> GetFeatureAsync(global::examples.Point request, CancellationToken token = default(CancellationToken));
- AsyncServerStreamingCall<global::examples.Feature> ListFeatures(global::examples.Rectangle request, CancellationToken token = default(CancellationToken));
- AsyncClientStreamingCall<global::examples.Point, global::examples.RouteSummary> RecordRoute(CancellationToken token = default(CancellationToken));
- AsyncDuplexStreamingCall<global::examples.RouteNote, global::examples.RouteNote> RouteChat(CancellationToken token = default(CancellationToken));
+ global::Examples.Feature GetFeature(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ global::Examples.Feature GetFeature(global::Examples.Point request, CallOptions options);
+ AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, CallOptions options);
+ AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, CallOptions options);
+ AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(CallOptions options);
+ AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(CallOptions options);
}
// server-side interface
public interface IRouteGuide
{
- Task<global::examples.Feature> GetFeature(ServerCallContext context, global::examples.Point request);
- Task ListFeatures(ServerCallContext context, global::examples.Rectangle request, IServerStreamWriter<global::examples.Feature> responseStream);
- Task<global::examples.RouteSummary> RecordRoute(ServerCallContext context, IAsyncStreamReader<global::examples.Point> requestStream);
- Task RouteChat(ServerCallContext context, IAsyncStreamReader<global::examples.RouteNote> requestStream, IServerStreamWriter<global::examples.RouteNote> responseStream);
+ Task<global::Examples.Feature> GetFeature(global::Examples.Point request, ServerCallContext context);
+ Task ListFeatures(global::Examples.Rectangle request, IServerStreamWriter<global::Examples.Feature> responseStream, ServerCallContext context);
+ Task<global::Examples.RouteSummary> RecordRoute(IAsyncStreamReader<global::Examples.Point> requestStream, ServerCallContext context);
+ Task RouteChat(IAsyncStreamReader<global::Examples.RouteNote> requestStream, IServerStreamWriter<global::Examples.RouteNote> responseStream, ServerCallContext context);
}
// client stub
- public class RouteGuideClient : AbstractStub<RouteGuideClient, StubConfiguration>, IRouteGuideClient
+ public class RouteGuideClient : ClientBase, IRouteGuideClient
{
- public RouteGuideClient(Channel channel) : this(channel, StubConfiguration.Default)
+ public RouteGuideClient(Channel channel) : base(channel)
+ {
+ }
+ public global::Examples.Feature GetFeature(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.BlockingUnaryCall(call, request);
+ }
+ public global::Examples.Feature GetFeature(global::Examples.Point request, CallOptions options)
{
+ var call = CreateCall(__Method_GetFeature, options);
+ return Calls.BlockingUnaryCall(call, request);
}
- public RouteGuideClient(Channel channel, StubConfiguration config) : base(channel, config)
+ public AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
+ var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncUnaryCall(call, request);
}
- public global::examples.Feature GetFeature(global::examples.Point request, CancellationToken token = default(CancellationToken))
+ public AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, CallOptions options)
{
- var call = CreateCall(__ServiceName, __Method_GetFeature);
- return Calls.BlockingUnaryCall(call, request, token);
+ var call = CreateCall(__Method_GetFeature, options);
+ return Calls.AsyncUnaryCall(call, request);
}
- public Task<global::examples.Feature> GetFeatureAsync(global::examples.Point request, CancellationToken token = default(CancellationToken))
+ public AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
- var call = CreateCall(__ServiceName, __Method_GetFeature);
- return Calls.AsyncUnaryCall(call, request, token);
+ var call = CreateCall(__Method_ListFeatures, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncServerStreamingCall(call, request);
}
- public AsyncServerStreamingCall<global::examples.Feature> ListFeatures(global::examples.Rectangle request, CancellationToken token = default(CancellationToken))
+ public AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, CallOptions options)
{
- var call = CreateCall(__ServiceName, __Method_ListFeatures);
- return Calls.AsyncServerStreamingCall(call, request, token);
+ var call = CreateCall(__Method_ListFeatures, options);
+ return Calls.AsyncServerStreamingCall(call, request);
}
- public AsyncClientStreamingCall<global::examples.Point, global::examples.RouteSummary> RecordRoute(CancellationToken token = default(CancellationToken))
+ public AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
- var call = CreateCall(__ServiceName, __Method_RecordRoute);
- return Calls.AsyncClientStreamingCall(call, token);
+ var call = CreateCall(__Method_RecordRoute, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncClientStreamingCall(call);
}
- public AsyncDuplexStreamingCall<global::examples.RouteNote, global::examples.RouteNote> RouteChat(CancellationToken token = default(CancellationToken))
+ public AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(CallOptions options)
{
- var call = CreateCall(__ServiceName, __Method_RouteChat);
- return Calls.AsyncDuplexStreamingCall(call, token);
+ var call = CreateCall(__Method_RecordRoute, options);
+ return Calls.AsyncClientStreamingCall(call);
+ }
+ public AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var call = CreateCall(__Method_RouteChat, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncDuplexStreamingCall(call);
+ }
+ public AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(CallOptions options)
+ {
+ var call = CreateCall(__Method_RouteChat, options);
+ return Calls.AsyncDuplexStreamingCall(call);
}
}
@@ -107,17 +144,12 @@ namespace examples {
.AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build();
}
- // creates a new client stub
- public static IRouteGuideClient NewStub(Channel channel)
+ // creates a new client
+ public static RouteGuideClient NewClient(Channel channel)
{
return new RouteGuideClient(channel);
}
- // creates a new client stub
- public static IRouteGuideClient NewStub(Channel channel, StubConfiguration config)
- {
- return new RouteGuideClient(channel, config);
- }
}
}
#endregion
diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuideUtil.cs b/examples/csharp/route_guide/RouteGuide/RouteGuideUtil.cs
index 6fb8b1e28a..1e07872488 100644
--- a/examples/csharp/route_guide/RouteGuide/RouteGuideUtil.cs
+++ b/examples/csharp/route_guide/RouteGuide/RouteGuideUtil.cs
@@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace examples
+namespace Examples
{
public static class RouteGuideUtil
{
diff --git a/examples/csharp/route_guide/RouteGuide/packages.config b/examples/csharp/route_guide/RouteGuide/packages.config
index 79abe0aa65..77cd1f5523 100644
--- a/examples/csharp/route_guide/RouteGuide/packages.config
+++ b/examples/csharp/route_guide/RouteGuide/packages.config
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.ProtocolBuffers" version="2.4.1.555" targetFramework="net45" />
- <package id="Grpc" version="0.6.0" targetFramework="net45" />
- <package id="Grpc.Core" version="0.6.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
+ <package id="Grpc" version="0.7.0-preview20150827" targetFramework="net45" />
+ <package id="Grpc.Core" version="0.7.0-preview20150827" targetFramework="net45" />
<package id="grpc.dependencies.openssl.redist" version="1.0.2.2" targetFramework="net45" />
<package id="grpc.dependencies.zlib.redist" version="1.2.8.9" targetFramework="net45" />
- <package id="grpc.native.csharp_ext" version="0.10.0" targetFramework="net45" />
+ <package id="grpc.native.csharp_ext" version="0.11.0-preview20150827" targetFramework="net45" />
<package id="Ix-Async" version="1.2.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1-beta2" targetFramework="net45" />
- <package id="System.Collections.Immutable" version="1.1.36" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/examples/csharp/route_guide/RouteGuide/protos/route_guide.proto b/examples/csharp/route_guide/RouteGuide/protos/route_guide.proto
deleted file mode 100644
index f4110b5515..0000000000
--- a/examples/csharp/route_guide/RouteGuide/protos/route_guide.proto
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// 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.
-
-// TODO(jtattermusch): as of now, C# protobufs don't officially support
-// proto3.
-syntax = "proto2";
-
-package examples;
-
-// Interface exported by the server.
-service RouteGuide {
- // A simple RPC.
- //
- // Obtains the feature at a given position.
- //
- // A feature with an empty name is returned if there's no feature at the given
- // position.
- rpc GetFeature(Point) returns (Feature) {}
-
- // A server-to-client streaming RPC.
- //
- // Obtains the Features available within the given Rectangle. Results are
- // streamed rather than returned at once (e.g. in a response message with a
- // repeated field), as the rectangle may cover a large area and contain a
- // huge number of features.
- rpc ListFeatures(Rectangle) returns (stream Feature) {}
-
- // A client-to-server streaming RPC.
- //
- // Accepts a stream of Points on a route being traversed, returning a
- // RouteSummary when traversal is completed.
- rpc RecordRoute(stream Point) returns (RouteSummary) {}
-
- // A Bidirectional streaming RPC.
- //
- // Accepts a stream of RouteNotes sent while a route is being traversed,
- // while receiving other RouteNotes (e.g. from other users).
- rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
-}
-
-// Points are represented as latitude-longitude pairs in the E7 representation
-// (degrees multiplied by 10**7 and rounded to the nearest integer).
-// Latitudes should be in the range +/- 90 degrees and longitude should be in
-// the range +/- 180 degrees (inclusive).
-message Point {
- optional int32 latitude = 1;
- optional int32 longitude = 2;
-}
-
-// A latitude-longitude rectangle, represented as two diagonally opposite
-// points "lo" and "hi".
-message Rectangle {
- // One corner of the rectangle.
- optional Point lo = 1;
-
- // The other corner of the rectangle.
- optional Point hi = 2;
-}
-
-// A feature names something at a given point.
-//
-// If a feature could not be named, the name is empty.
-message Feature {
- // The name of the feature.
- optional string name = 1;
-
- // The point where the feature is detected.
- optional Point location = 2;
-}
-
-// A RouteNote is a message sent while at a given point.
-message RouteNote {
- // The location from which the message is sent.
- optional Point location = 1;
-
- // The message to be sent.
- optional string message = 2;
-}
-
-// A RouteSummary is received in response to a RecordRoute rpc.
-//
-// It contains the number of individual points received, the number of
-// detected features, and the total distance covered as the cumulative sum of
-// the distance between each point.
-message RouteSummary {
- // The number of points received.
- optional int32 point_count = 1;
-
- // The number of known features passed while traversing the route.
- optional int32 feature_count = 2;
-
- // The distance covered in metres.
- optional int32 distance = 3;
-
- // The duration of the traversal in seconds.
- optional int32 elapsed_time = 4;
-}
diff --git a/examples/csharp/route_guide/RouteGuideClient/Program.cs b/examples/csharp/route_guide/RouteGuideClient/Program.cs
index 0352c78020..2f1d631cce 100644
--- a/examples/csharp/route_guide/RouteGuideClient/Program.cs
+++ b/examples/csharp/route_guide/RouteGuideClient/Program.cs
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace examples
+namespace Examples
{
class Program
{
diff --git a/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj b/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj
index 78034a9145..584183b6a5 100644
--- a/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj
+++ b/examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props" Condition="Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props')" />
+ <Import Project="..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props" Condition="Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props')" />
<Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props')" />
<Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.props" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -14,7 +14,7 @@
<AssemblyName>RouteGuideClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
- <NuGetPackageImportStamp>794416d0</NuGetPackageImportStamp>
+ <NuGetPackageImportStamp>9d8cff17</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -36,21 +36,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Google.ProtocolBuffers">
- <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll</HintPath>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference>
- <Reference Include="Google.ProtocolBuffers.Serialization">
- <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
- </Reference>
- <Reference Include="Grpc.Core, Version=0.6.5668.37363, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Grpc.Core.0.6.0\lib\net45\Grpc.Core.dll</HintPath>
+ <Reference Include="Grpc.Core">
+ <HintPath>..\packages\Grpc.Core.0.7.0-preview20150827\lib\net45\Grpc.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
- <Reference Include="System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
- </Reference>
<Reference Include="System.Core" />
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
@@ -84,12 +76,12 @@
<Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets'))" />
<Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props'))" />
<Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets'))" />
- <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props'))" />
- <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets'))" />
+ <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props'))" />
+ <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets'))" />
</Target>
<Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets')" />
<Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets')" />
- <Import Project="..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets" Condition="Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets')" />
+ <Import Project="..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets" Condition="Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/examples/csharp/route_guide/RouteGuideClient/packages.config b/examples/csharp/route_guide/RouteGuideClient/packages.config
index 5922553bc3..1a34e4cf92 100644
--- a/examples/csharp/route_guide/RouteGuideClient/packages.config
+++ b/examples/csharp/route_guide/RouteGuideClient/packages.config
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.ProtocolBuffers" version="2.4.1.555" targetFramework="net45" />
- <package id="Grpc" version="0.6.0" targetFramework="net45" />
- <package id="Grpc.Core" version="0.6.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
+ <package id="Grpc" version="0.7.0-preview20150827" targetFramework="net45" />
+ <package id="Grpc.Core" version="0.7.0-preview20150827" targetFramework="net45" />
<package id="grpc.dependencies.openssl.redist" version="1.0.2.2" targetFramework="net45" />
<package id="grpc.dependencies.zlib.redist" version="1.2.8.9" targetFramework="net45" />
- <package id="grpc.native.csharp_ext" version="0.10.0" targetFramework="net45" />
+ <package id="grpc.native.csharp_ext" version="0.11.0-preview20150827" targetFramework="net45" />
<package id="Ix-Async" version="1.2.3" targetFramework="net45" />
- <package id="System.Collections.Immutable" version="1.1.36" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/examples/csharp/route_guide/RouteGuideServer/Program.cs b/examples/csharp/route_guide/RouteGuideServer/Program.cs
index e00b4d6723..68efce9f4a 100644
--- a/examples/csharp/route_guide/RouteGuideServer/Program.cs
+++ b/examples/csharp/route_guide/RouteGuideServer/Program.cs
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace examples
+namespace Examples
{
class Program
{
diff --git a/examples/csharp/route_guide/RouteGuideServer/RouteGuideImpl.cs b/examples/csharp/route_guide/RouteGuideServer/RouteGuideImpl.cs
index 0bdf386fc3..1de37e3869 100644
--- a/examples/csharp/route_guide/RouteGuideServer/RouteGuideImpl.cs
+++ b/examples/csharp/route_guide/RouteGuideServer/RouteGuideImpl.cs
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace examples
+namespace Examples
{
/// <summary>
/// Example implementation of RouteGuide server.
diff --git a/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj b/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj
index 9ac1cfbf4d..920d129764 100644
--- a/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj
+++ b/examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props" Condition="Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props')" />
+ <Import Project="..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props" Condition="Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props')" />
<Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props')" />
<Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.props" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -14,7 +14,7 @@
<AssemblyName>RouteGuideServer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
- <NuGetPackageImportStamp>74781d8b</NuGetPackageImportStamp>
+ <NuGetPackageImportStamp>87e00dd6</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -36,21 +36,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Google.ProtocolBuffers">
- <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll</HintPath>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
</Reference>
- <Reference Include="Google.ProtocolBuffers.Serialization">
- <HintPath>..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
- </Reference>
- <Reference Include="Grpc.Core, Version=0.6.5668.37363, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Grpc.Core.0.6.0\lib\net45\Grpc.Core.dll</HintPath>
+ <Reference Include="Grpc.Core">
+ <HintPath>..\packages\Grpc.Core.0.7.0-preview20150827\lib\net45\Grpc.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
- <Reference Include="System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
- </Reference>
<Reference Include="System.Core" />
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
@@ -85,12 +77,12 @@
<Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets'))" />
<Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.props'))" />
<Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets'))" />
- <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.props'))" />
- <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets'))" />
+ <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.props'))" />
+ <Error Condition="!Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets'))" />
</Target>
<Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.9\build\portable-net45\grpc.dependencies.zlib.redist.targets')" />
<Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.2.2\build\portable-net45\grpc.dependencies.openssl.redist.targets')" />
- <Import Project="..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets" Condition="Exists('..\packages\grpc.native.csharp_ext.0.10.0\build\portable-net45\grpc.native.csharp_ext.targets')" />
+ <Import Project="..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets" Condition="Exists('..\packages\grpc.native.csharp_ext.0.11.0-preview20150827\build\portable-net45\grpc.native.csharp_ext.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/examples/csharp/route_guide/RouteGuideServer/packages.config b/examples/csharp/route_guide/RouteGuideServer/packages.config
index 5922553bc3..1a34e4cf92 100644
--- a/examples/csharp/route_guide/RouteGuideServer/packages.config
+++ b/examples/csharp/route_guide/RouteGuideServer/packages.config
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.ProtocolBuffers" version="2.4.1.555" targetFramework="net45" />
- <package id="Grpc" version="0.6.0" targetFramework="net45" />
- <package id="Grpc.Core" version="0.6.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
+ <package id="Grpc" version="0.7.0-preview20150827" targetFramework="net45" />
+ <package id="Grpc.Core" version="0.7.0-preview20150827" targetFramework="net45" />
<package id="grpc.dependencies.openssl.redist" version="1.0.2.2" targetFramework="net45" />
<package id="grpc.dependencies.zlib.redist" version="1.2.8.9" targetFramework="net45" />
- <package id="grpc.native.csharp_ext" version="0.10.0" targetFramework="net45" />
+ <package id="grpc.native.csharp_ext" version="0.11.0-preview20150827" targetFramework="net45" />
<package id="Ix-Async" version="1.2.3" targetFramework="net45" />
- <package id="System.Collections.Immutable" version="1.1.36" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/examples/csharp/route_guide/generate_protos.bat b/examples/csharp/route_guide/generate_protos.bat
new file mode 100644
index 0000000000..70662c03cf
--- /dev/null
+++ b/examples/csharp/route_guide/generate_protos.bat
@@ -0,0 +1,10 @@
+@rem Generate the C# code for .proto files
+
+setlocal
+
+@rem enter this directory
+cd /d %~dp0
+
+packages\Google.Protobuf.3.0.0-alpha4\tools\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.7.0-preview20150827\tools\grpc_csharp_plugin.exe
+
+endlocal \ No newline at end of file