/// <summary>
        /// Clears an extension.
        /// </summary>
        public TBuilder ClearExtension <TExtension>(GeneratedExtensionLite <TMessage, TExtension> extension)
        {
            ExtendableMessageLite <TMessage, TBuilder> message = MessageBeingBuilt;

            message.VerifyExtensionContainingType(extension);
            message.Extensions.ClearField(extension.Descriptor);
            return(ThisBuilder);
        }
        public TBuilder SetExtension <TExtension>(GeneratedExtensionLite <TMessage, IList <TExtension> > extension, int index, TExtension value)
        {
            ExtendableMessageLite <TMessage, TBuilder> extendableMessageLite = this.MessageBeingBuilt;

            extendableMessageLite.VerifyExtensionContainingType <IList <TExtension> >(extension);
            extendableMessageLite.Extensions[extension.Descriptor, index] = extension.SingularToReflectionType(value);
            return(this.ThisBuilder);
        }
        public TBuilder AddExtension <TExtension>(GeneratedExtensionLite <TMessage, IList <TExtension> > extension, TExtension value)
        {
            ExtendableMessageLite <TMessage, TBuilder> extendableMessageLite = this.MessageBeingBuilt;

            extendableMessageLite.VerifyExtensionContainingType <IList <TExtension> >(extension);
            extendableMessageLite.Extensions.AddRepeatedField(extension.Descriptor, extension.SingularToReflectionType(value));
            return(this.ThisBuilder);
        }
예제 #4
0
        /// <summary>
        /// Sets the value of an extension.
        /// </summary>
        public TBuilder SetExtension <TExtension>(GeneratedExtensionLite <TMessage, TExtension> extension, TExtension value)
        {
            ExtendableMessageLite <TMessage, TBuilder> message = MessageBeingBuilt;

            message.VerifyExtensionContainingType(extension);
            message.Extensions[extension.Descriptor] = extension.ToReflectionType(value);
            return(ThisBuilder);
        }