IExtensible.cs 1.0 KB

123456789101112131415161718192021222324252627
  1. 
  2. namespace ProtoBuf
  3. {
  4. /// <summary>
  5. /// Indicates that the implementing type has support for protocol-buffer
  6. /// <see cref="IExtension">extensions</see>.
  7. /// </summary>
  8. /// <remarks>Can be implemented by deriving from Extensible.</remarks>
  9. public interface IExtensible
  10. {
  11. /// <summary>
  12. /// Retrieves the <see cref="IExtension">extension</see> object for the current
  13. /// instance, optionally creating it if it does not already exist.
  14. /// </summary>
  15. /// <param name="createIfMissing">Should a new extension object be
  16. /// created if it does not already exist?</param>
  17. /// <returns>The extension object if it exists (or was created), or null
  18. /// if the extension object does not exist or is not available.</returns>
  19. /// <remarks>The <c>createIfMissing</c> argument is false during serialization,
  20. /// and true during deserialization upon encountering unexpected fields.</remarks>
  21. IExtension GetExtensionObject(bool createIfMissing);
  22. }
  23. }