GeneratedExtension.cs 972 B

12345678910111213141516171819202122232425262728293031
  1. using Google.ProtocolBuffers.Descriptors;
  2. namespace Google.ProtocolBuffers {
  3. /// <summary>
  4. /// Base class for all generated extensions.
  5. /// </summary>
  6. /// <remarks>
  7. /// The protocol compiler generates a static singleton instance of this
  8. /// class for each extension. For exmaple, imagine a .proto file with:
  9. /// <code>
  10. /// message Foo {
  11. /// extensions 1000 to max
  12. /// }
  13. ///
  14. /// extend Foo {
  15. /// optional int32 bar;
  16. /// }
  17. /// </code>
  18. /// Then MyProto.Foo.Bar has type GeneratedExtension&lt;MyProto.Foo,int&gt;.
  19. /// <para />
  20. /// In general, users should ignore the details of this type, and
  21. /// simply use the static singletons as parmaeters to the extension accessors
  22. /// in ExtendableMessage and ExtendableBuilder.
  23. /// </remarks>
  24. public class GeneratedExtension<TContainer, TExtension> where TContainer : IMessage<TContainer> {
  25. public FieldDescriptor Descriptor;
  26. public IMessage MessageDefaultInstance;
  27. }
  28. }