Skip to content

net472_PropertyGridHelpers.Attributes_LocalizedTextAttribute_GetLocalizedText

dparvin edited this page Jul 9, 2025 · 12 revisions

LocalizedTextAttribute.GetLocalizedText method

Resolves and retrieves the localized text for this attribute using the provided target type's associated ResourcePathAttribute.

public string GetLocalizedText(ITypeDescriptorContext context, CultureInfo culture, Type targetType)
parameter description
context The context.
culture The culture.
targetType The type whose resource path is used to locate the resource class.

Return Value

The resolved localized string based on the ResourceKey and the target type's resource path.

Exceptions

exception condition
InvalidOperationException ResourcePathAttribute not found on {targetType.FullName} or Resource type '{fullResourcePath}' not found in assembly '{rootNamespace}'
InvalidOperationException Thrown if the ResourcePathAttribute is missing or if the resource type cannot be located in the assembly.

See Also

Clone this wiki locally