UnittestIssues.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: unittest_issues.proto
  3. #pragma warning disable 1591, 0612, 3021
  4. #region Designer generated code
  5. using pb = global::Google.Protobuf;
  6. using pbc = global::Google.Protobuf.Collections;
  7. using pbd = global::Google.Protobuf.Descriptors;
  8. using scg = global::System.Collections.Generic;
  9. namespace UnitTest.Issues.TestProtos {
  10. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  11. public static partial class UnittestIssues {
  12. #region Static variables
  13. internal static pbd::MessageDescriptor internal__static_unittest_issues_NegativeEnumMessage__Descriptor;
  14. internal static pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.NegativeEnumMessage> internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable;
  15. internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedChild__Descriptor;
  16. internal static pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.DeprecatedChild> internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable;
  17. internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor;
  18. internal static pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage> internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable;
  19. internal static pbd::MessageDescriptor internal__static_unittest_issues_ItemField__Descriptor;
  20. internal static pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.ItemField> internal__static_unittest_issues_ItemField__FieldAccessorTable;
  21. #endregion
  22. #region Descriptor
  23. public static pbd::FileDescriptor Descriptor {
  24. get { return descriptor; }
  25. }
  26. private static pbd::FileDescriptor descriptor;
  27. static UnittestIssues() {
  28. byte[] descriptorData = global::System.Convert.FromBase64String(
  29. string.Concat(
  30. "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyKwAQoT",
  31. "TmVnYXRpdmVFbnVtTWVzc2FnZRIsCgV2YWx1ZRgBIAEoDjIdLnVuaXR0ZXN0",
  32. "X2lzc3Vlcy5OZWdhdGl2ZUVudW0SMQoGdmFsdWVzGAIgAygOMh0udW5pdHRl",
  33. "c3RfaXNzdWVzLk5lZ2F0aXZlRW51bUICEAASOAoNcGFja2VkX3ZhbHVlcxgD",
  34. "IAMoDjIdLnVuaXR0ZXN0X2lzc3Vlcy5OZWdhdGl2ZUVudW1CAhABIhEKD0Rl",
  35. "cHJlY2F0ZWRDaGlsZCK5AgoXRGVwcmVjYXRlZEZpZWxkc01lc3NhZ2USGgoO",
  36. "UHJpbWl0aXZlVmFsdWUYASABKAVCAhgBEhoKDlByaW1pdGl2ZUFycmF5GAIg",
  37. "AygFQgIYARI6CgxNZXNzYWdlVmFsdWUYAyABKAsyIC51bml0dGVzdF9pc3N1",
  38. "ZXMuRGVwcmVjYXRlZENoaWxkQgIYARI6CgxNZXNzYWdlQXJyYXkYBCADKAsy",
  39. "IC51bml0dGVzdF9pc3N1ZXMuRGVwcmVjYXRlZENoaWxkQgIYARI2CglFbnVt",
  40. "VmFsdWUYBSABKA4yHy51bml0dGVzdF9pc3N1ZXMuRGVwcmVjYXRlZEVudW1C",
  41. "AhgBEjYKCUVudW1BcnJheRgGIAMoDjIfLnVuaXR0ZXN0X2lzc3Vlcy5EZXBy",
  42. "ZWNhdGVkRW51bUICGAEiGQoJSXRlbUZpZWxkEgwKBGl0ZW0YASABKAUqVQoM",
  43. "TmVnYXRpdmVFbnVtEhYKEk5FR0FUSVZFX0VOVU1fWkVSTxAAEhYKCUZpdmVC",
  44. "ZWxvdxD7//////////8BEhUKCE1pbnVzT25lEP///////////wEqLgoORGVw",
  45. "cmVjYXRlZEVudW0SEwoPREVQUkVDQVRFRF9aRVJPEAASBwoDb25lEAFCH0gB",
  46. "qgIaVW5pdFRlc3QuSXNzdWVzLlRlc3RQcm90b3NiBnByb3RvMw=="));
  47. pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
  48. descriptor = root;
  49. internal__static_unittest_issues_NegativeEnumMessage__Descriptor = Descriptor.MessageTypes[0];
  50. internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable =
  51. new pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.NegativeEnumMessage>(internal__static_unittest_issues_NegativeEnumMessage__Descriptor,
  52. new string[] { "Value", "Values", "PackedValues", });
  53. internal__static_unittest_issues_DeprecatedChild__Descriptor = Descriptor.MessageTypes[1];
  54. internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable =
  55. new pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.DeprecatedChild>(internal__static_unittest_issues_DeprecatedChild__Descriptor,
  56. new string[] { });
  57. internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor = Descriptor.MessageTypes[2];
  58. internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable =
  59. new pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage>(internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor,
  60. new string[] { "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray", });
  61. internal__static_unittest_issues_ItemField__Descriptor = Descriptor.MessageTypes[3];
  62. internal__static_unittest_issues_ItemField__FieldAccessorTable =
  63. new pb::FieldAccess.FieldAccessorTable<global::UnitTest.Issues.TestProtos.ItemField>(internal__static_unittest_issues_ItemField__Descriptor,
  64. new string[] { "Item", });
  65. };
  66. pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
  67. new pbd::FileDescriptor[] {
  68. }, assigner);
  69. }
  70. #endregion
  71. }
  72. #region Enums
  73. public enum NegativeEnum {
  74. NEGATIVE_ENUM_ZERO = 0,
  75. FiveBelow = -5,
  76. MinusOne = -1,
  77. }
  78. public enum DeprecatedEnum {
  79. DEPRECATED_ZERO = 0,
  80. one = 1,
  81. }
  82. #endregion
  83. #region Messages
  84. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  85. public sealed partial class NegativeEnumMessage : pb::IMessage<NegativeEnumMessage>, global::System.IEquatable<NegativeEnumMessage> {
  86. private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage());
  87. public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } }
  88. private static readonly string[] _fieldNames = new string[] { "packed_values", "value", "values" };
  89. private static readonly uint[] _fieldTags = new uint[] { 26, 8, 16 };
  90. public static pbd::MessageDescriptor Descriptor {
  91. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__Descriptor; }
  92. }
  93. public pb::FieldAccess.FieldAccessorTable<NegativeEnumMessage> Fields {
  94. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; }
  95. }
  96. public NegativeEnumMessage() { }
  97. public NegativeEnumMessage(NegativeEnumMessage other) {
  98. MergeFrom(other);
  99. }
  100. public const int ValueFieldNumber = 1;
  101. private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO;
  102. public global::UnitTest.Issues.TestProtos.NegativeEnum Value {
  103. get { return value_; }
  104. set { value_ = value; }
  105. }
  106. public const int ValuesFieldNumber = 2;
  107. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  108. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values {
  109. get { return values_; }
  110. }
  111. public const int PackedValuesFieldNumber = 3;
  112. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>();
  113. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues {
  114. get { return packedValues_; }
  115. }
  116. public override bool Equals(object other) {
  117. return Equals(other as NegativeEnumMessage);
  118. }
  119. public bool Equals(NegativeEnumMessage other) {
  120. if (ReferenceEquals(other, null)) {
  121. return false;
  122. }
  123. if (ReferenceEquals(other, this)) {
  124. return true;
  125. }
  126. if (Value != other.Value) return false;
  127. if(!values_.Equals(other.values_)) return false;
  128. if(!packedValues_.Equals(other.packedValues_)) return false;
  129. return true;
  130. }
  131. public override int GetHashCode() {
  132. int hash = 0;
  133. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) hash ^= Value.GetHashCode();
  134. hash ^= values_.GetHashCode();
  135. hash ^= packedValues_.GetHashCode();
  136. return hash;
  137. }
  138. public void WriteTo(pb::CodedOutputStream output) {
  139. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
  140. output.WriteRawTag(8);
  141. output.WriteEnum((int) Value);
  142. }
  143. if (values_.Count > 0) {
  144. output.WriteEnumArray(2, values_);
  145. }
  146. if (packedValues_.Count > 0) {
  147. output.WriteRawTag(26);
  148. output.WritePackedEnumArray(packedValues_);
  149. }
  150. }
  151. public int CalculateSize() {
  152. int size = 0;
  153. if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
  154. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value);
  155. }
  156. if (values_.Count > 0) {
  157. int dataSize = 0;
  158. foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in values_) {
  159. dataSize += pb::CodedOutputStream.ComputeEnumSize((int) element);
  160. }
  161. size += dataSize;
  162. size += 1 * values_.Count;
  163. }
  164. if (packedValues_.Count > 0) {
  165. int dataSize = 0;
  166. foreach (global::UnitTest.Issues.TestProtos.NegativeEnum element in packedValues_) {
  167. dataSize += pb::CodedOutputStream.ComputeEnumSize((int) element);
  168. }
  169. size += dataSize;
  170. size += 1 + pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
  171. }
  172. return size;
  173. }
  174. public void MergeFrom(NegativeEnumMessage other) {
  175. if (other == null) {
  176. return;
  177. }
  178. if (other.Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) {
  179. Value = other.Value;
  180. }
  181. values_.Add(other.values_);
  182. packedValues_.Add(other.packedValues_);
  183. }
  184. public void MergeFrom(pb::CodedInputStream input) {
  185. uint tag;
  186. while (input.ReadTag(out tag)) {
  187. switch(tag) {
  188. case 0:
  189. throw pb::InvalidProtocolBufferException.InvalidTag();
  190. default:
  191. if (pb::WireFormat.IsEndGroupTag(tag)) {
  192. return;
  193. }
  194. break;
  195. case 8: {
  196. value_ = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
  197. break;
  198. }
  199. case 18:
  200. case 16: {
  201. input.ReadEnumArray<global::UnitTest.Issues.TestProtos.NegativeEnum>(values_);
  202. break;
  203. }
  204. case 26:
  205. case 24: {
  206. input.ReadEnumArray<global::UnitTest.Issues.TestProtos.NegativeEnum>(packedValues_);
  207. break;
  208. }
  209. }
  210. }
  211. }
  212. }
  213. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  214. public sealed partial class DeprecatedChild : pb::IMessage<DeprecatedChild>, global::System.IEquatable<DeprecatedChild> {
  215. private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild());
  216. public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } }
  217. private static readonly string[] _fieldNames = new string[] { };
  218. private static readonly uint[] _fieldTags = new uint[] { };
  219. public static pbd::MessageDescriptor Descriptor {
  220. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__Descriptor; }
  221. }
  222. public pb::FieldAccess.FieldAccessorTable<DeprecatedChild> Fields {
  223. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; }
  224. }
  225. public DeprecatedChild() { }
  226. public DeprecatedChild(DeprecatedChild other) {
  227. MergeFrom(other);
  228. }
  229. public override bool Equals(object other) {
  230. return Equals(other as DeprecatedChild);
  231. }
  232. public bool Equals(DeprecatedChild other) {
  233. if (ReferenceEquals(other, null)) {
  234. return false;
  235. }
  236. if (ReferenceEquals(other, this)) {
  237. return true;
  238. }
  239. return true;
  240. }
  241. public override int GetHashCode() {
  242. int hash = 0;
  243. return hash;
  244. }
  245. public void WriteTo(pb::CodedOutputStream output) {
  246. }
  247. public int CalculateSize() {
  248. int size = 0;
  249. return size;
  250. }
  251. public void MergeFrom(DeprecatedChild other) {
  252. if (other == null) {
  253. return;
  254. }
  255. }
  256. public void MergeFrom(pb::CodedInputStream input) {
  257. uint tag;
  258. while (input.ReadTag(out tag)) {
  259. switch(tag) {
  260. case 0:
  261. throw pb::InvalidProtocolBufferException.InvalidTag();
  262. default:
  263. if (pb::WireFormat.IsEndGroupTag(tag)) {
  264. return;
  265. }
  266. break;
  267. }
  268. }
  269. }
  270. }
  271. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  272. public sealed partial class DeprecatedFieldsMessage : pb::IMessage<DeprecatedFieldsMessage>, global::System.IEquatable<DeprecatedFieldsMessage> {
  273. private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage());
  274. public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } }
  275. private static readonly string[] _fieldNames = new string[] { "EnumArray", "EnumValue", "MessageArray", "MessageValue", "PrimitiveArray", "PrimitiveValue" };
  276. private static readonly uint[] _fieldTags = new uint[] { 50, 40, 34, 26, 18, 8 };
  277. public static pbd::MessageDescriptor Descriptor {
  278. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor; }
  279. }
  280. public pb::FieldAccess.FieldAccessorTable<DeprecatedFieldsMessage> Fields {
  281. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; }
  282. }
  283. public DeprecatedFieldsMessage() { }
  284. public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) {
  285. MergeFrom(other);
  286. }
  287. public const int PrimitiveValueFieldNumber = 1;
  288. private int primitiveValue_;
  289. [global::System.ObsoleteAttribute()]
  290. public int PrimitiveValue {
  291. get { return primitiveValue_; }
  292. set { primitiveValue_ = value; }
  293. }
  294. public const int PrimitiveArrayFieldNumber = 2;
  295. private readonly pbc::RepeatedField<int> primitiveArray_ = new pbc::RepeatedField<int>();
  296. [global::System.ObsoleteAttribute()]
  297. public pbc::RepeatedField<int> PrimitiveArray {
  298. get { return primitiveArray_; }
  299. }
  300. public const int MessageValueFieldNumber = 3;
  301. private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_;
  302. [global::System.ObsoleteAttribute()]
  303. public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue {
  304. get { return messageValue_; }
  305. set { messageValue_ = value; }
  306. }
  307. public const int MessageArrayFieldNumber = 4;
  308. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> messageArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild>();
  309. [global::System.ObsoleteAttribute()]
  310. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedChild> MessageArray {
  311. get { return messageArray_; }
  312. }
  313. public const int EnumValueFieldNumber = 5;
  314. private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO;
  315. [global::System.ObsoleteAttribute()]
  316. public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue {
  317. get { return enumValue_; }
  318. set { enumValue_ = value; }
  319. }
  320. public const int EnumArrayFieldNumber = 6;
  321. private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>();
  322. [global::System.ObsoleteAttribute()]
  323. public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray {
  324. get { return enumArray_; }
  325. }
  326. public override bool Equals(object other) {
  327. return Equals(other as DeprecatedFieldsMessage);
  328. }
  329. public bool Equals(DeprecatedFieldsMessage other) {
  330. if (ReferenceEquals(other, null)) {
  331. return false;
  332. }
  333. if (ReferenceEquals(other, this)) {
  334. return true;
  335. }
  336. if (PrimitiveValue != other.PrimitiveValue) return false;
  337. if(!primitiveArray_.Equals(other.primitiveArray_)) return false;
  338. if (!object.Equals(MessageValue, other.MessageValue)) return false;if(!messageArray_.Equals(other.messageArray_)) return false;
  339. if (EnumValue != other.EnumValue) return false;
  340. if(!enumArray_.Equals(other.enumArray_)) return false;
  341. return true;
  342. }
  343. public override int GetHashCode() {
  344. int hash = 0;
  345. if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
  346. hash ^= primitiveArray_.GetHashCode();
  347. if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
  348. hash ^= messageArray_.GetHashCode();
  349. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) hash ^= EnumValue.GetHashCode();
  350. hash ^= enumArray_.GetHashCode();
  351. return hash;
  352. }
  353. public void WriteTo(pb::CodedOutputStream output) {
  354. if (PrimitiveValue != 0) {
  355. output.WriteRawTag(8);
  356. output.WriteInt32(PrimitiveValue);
  357. }
  358. if (primitiveArray_.Count > 0) {
  359. output.WriteRawTag(18);
  360. output.WritePackedInt32Array(primitiveArray_);
  361. }
  362. if (messageValue_ != null) {
  363. output.WriteRawTag(26);
  364. output.WriteMessage(MessageValue);
  365. }
  366. if (messageArray_.Count > 0) {
  367. output.WriteMessageArray(4, messageArray_);
  368. }
  369. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
  370. output.WriteRawTag(40);
  371. output.WriteEnum((int) EnumValue);
  372. }
  373. if (enumArray_.Count > 0) {
  374. output.WriteRawTag(50);
  375. output.WritePackedEnumArray(enumArray_);
  376. }
  377. }
  378. public int CalculateSize() {
  379. int size = 0;
  380. if (PrimitiveValue != 0) {
  381. size += 1 + pb::CodedOutputStream.ComputeInt32Size(PrimitiveValue);
  382. }
  383. if (primitiveArray_.Count > 0) {
  384. int dataSize = 0;
  385. foreach (int element in primitiveArray_) {
  386. dataSize += pb::CodedOutputStream.ComputeInt32Size(element);
  387. }
  388. size += dataSize;
  389. size += 1 + pb::CodedOutputStream.ComputeInt32Size(dataSize);
  390. }
  391. if (messageValue_ != null) {
  392. size += 1 + pb::CodedOutputStream.ComputeMessageSize(MessageValue);
  393. }
  394. if (messageArray_.Count > 0) {
  395. foreach (global::UnitTest.Issues.TestProtos.DeprecatedChild element in messageArray_) {
  396. size += pb::CodedOutputStream.ComputeMessageSize(element);
  397. }
  398. size += 1 * messageArray_.Count;
  399. }
  400. if (EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
  401. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EnumValue);
  402. }
  403. if (enumArray_.Count > 0) {
  404. int dataSize = 0;
  405. foreach (global::UnitTest.Issues.TestProtos.DeprecatedEnum element in enumArray_) {
  406. dataSize += pb::CodedOutputStream.ComputeEnumSize((int) element);
  407. }
  408. size += dataSize;
  409. size += 1 + pb::CodedOutputStream.ComputeRawVarint32Size((uint) dataSize);
  410. }
  411. return size;
  412. }
  413. public void MergeFrom(DeprecatedFieldsMessage other) {
  414. if (other == null) {
  415. return;
  416. }
  417. if (other.PrimitiveValue != 0) {
  418. PrimitiveValue = other.PrimitiveValue;
  419. }
  420. primitiveArray_.Add(other.primitiveArray_);
  421. if (other.messageValue_ != null) {
  422. if (messageValue_ == null) {
  423. messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  424. }
  425. MessageValue.MergeFrom(other.MessageValue);
  426. }
  427. messageArray_.Add(other.messageArray_);
  428. if (other.EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO) {
  429. EnumValue = other.EnumValue;
  430. }
  431. enumArray_.Add(other.enumArray_);
  432. }
  433. public void MergeFrom(pb::CodedInputStream input) {
  434. uint tag;
  435. while (input.ReadTag(out tag)) {
  436. switch(tag) {
  437. case 0:
  438. throw pb::InvalidProtocolBufferException.InvalidTag();
  439. default:
  440. if (pb::WireFormat.IsEndGroupTag(tag)) {
  441. return;
  442. }
  443. break;
  444. case 8: {
  445. PrimitiveValue = input.ReadInt32();
  446. break;
  447. }
  448. case 18:
  449. case 16: {
  450. input.ReadInt32Array(primitiveArray_);
  451. break;
  452. }
  453. case 26: {
  454. if (messageValue_ == null) {
  455. messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
  456. }
  457. input.ReadMessage(messageValue_);
  458. break;
  459. }
  460. case 34: {
  461. input.ReadMessageArray(messageArray_, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser);
  462. break;
  463. }
  464. case 40: {
  465. enumValue_ = (global::UnitTest.Issues.TestProtos.DeprecatedEnum) input.ReadEnum();
  466. break;
  467. }
  468. case 50:
  469. case 48: {
  470. input.ReadEnumArray<global::UnitTest.Issues.TestProtos.DeprecatedEnum>(enumArray_);
  471. break;
  472. }
  473. }
  474. }
  475. }
  476. }
  477. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  478. public sealed partial class ItemField : pb::IMessage<ItemField>, global::System.IEquatable<ItemField> {
  479. private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField());
  480. public static pb::MessageParser<ItemField> Parser { get { return _parser; } }
  481. private static readonly string[] _fieldNames = new string[] { "item" };
  482. private static readonly uint[] _fieldTags = new uint[] { 8 };
  483. public static pbd::MessageDescriptor Descriptor {
  484. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__Descriptor; }
  485. }
  486. public pb::FieldAccess.FieldAccessorTable<ItemField> Fields {
  487. get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__FieldAccessorTable; }
  488. }
  489. public ItemField() { }
  490. public ItemField(ItemField other) {
  491. MergeFrom(other);
  492. }
  493. public const int ItemFieldNumber = 1;
  494. private int item_;
  495. public int Item {
  496. get { return item_; }
  497. set { item_ = value; }
  498. }
  499. public override bool Equals(object other) {
  500. return Equals(other as ItemField);
  501. }
  502. public bool Equals(ItemField other) {
  503. if (ReferenceEquals(other, null)) {
  504. return false;
  505. }
  506. if (ReferenceEquals(other, this)) {
  507. return true;
  508. }
  509. if (Item != other.Item) return false;
  510. return true;
  511. }
  512. public override int GetHashCode() {
  513. int hash = 0;
  514. if (Item != 0) hash ^= Item.GetHashCode();
  515. return hash;
  516. }
  517. public void WriteTo(pb::CodedOutputStream output) {
  518. if (Item != 0) {
  519. output.WriteRawTag(8);
  520. output.WriteInt32(Item);
  521. }
  522. }
  523. public int CalculateSize() {
  524. int size = 0;
  525. if (Item != 0) {
  526. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Item);
  527. }
  528. return size;
  529. }
  530. public void MergeFrom(ItemField other) {
  531. if (other == null) {
  532. return;
  533. }
  534. if (other.Item != 0) {
  535. Item = other.Item;
  536. }
  537. }
  538. public void MergeFrom(pb::CodedInputStream input) {
  539. uint tag;
  540. while (input.ReadTag(out tag)) {
  541. switch(tag) {
  542. case 0:
  543. throw pb::InvalidProtocolBufferException.InvalidTag();
  544. default:
  545. if (pb::WireFormat.IsEndGroupTag(tag)) {
  546. return;
  547. }
  548. break;
  549. case 8: {
  550. Item = input.ReadInt32();
  551. break;
  552. }
  553. }
  554. }
  555. }
  556. }
  557. #endregion
  558. }
  559. #endregion Designer generated code