PackageDescriptor.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Google.ProtocolBuffers.Descriptors {
  5. /*
  6. * Represents a package in the symbol table. We use PackageDescriptors
  7. * just as placeholders so that someone cannot define, say, a message type
  8. * that has the same name as an existing package.
  9. */
  10. /// <summary>
  11. /// Represents a package in the symbol table. We use PackageDescriptors
  12. /// just as placeholders so that someone cannot define, say, a message type
  13. /// that has the same name as an existing package.
  14. /// </summary>
  15. internal class PackageDescriptor : IDescriptor<IMessage> {
  16. private readonly string name;
  17. private readonly string fullName;
  18. private readonly FileDescriptor file;
  19. internal PackageDescriptor(string name, string fullName, FileDescriptor file) {
  20. this.file = file;
  21. this.fullName = fullName;
  22. this.name = name;
  23. }
  24. public IMessage Proto {
  25. get { return file.Proto; }
  26. }
  27. public string Name {
  28. get { return name; }
  29. }
  30. public string FullName {
  31. get { return fullName; }
  32. }
  33. public FileDescriptor File {
  34. get { return file; }
  35. }
  36. }
  37. }