public TExtension GetExtension <TExtension>(GeneratedExtensionLite <TMessage, TExtension> extension) { this.VerifyExtensionContainingType <TExtension>(extension); object obj = this.extensions[extension.Descriptor]; if (obj == null) { return(extension.DefaultValue); } return((TExtension)((object)extension.FromReflectionType(obj))); }
/// <summary> /// Returns the value of an extension. /// </summary> public TExtension GetExtension <TExtension>(GeneratedExtensionLite <TMessage, TExtension> extension) { VerifyExtensionContainingType(extension); object value = extensions[extension.Descriptor]; if (value == null) { return(extension.DefaultValue); } else { return((TExtension)extension.FromReflectionType(value)); } }