LocalizableAttribute::IsLocalizable Property
.NET Framework (current version)
Gets a value indicating whether a property should be localized.
Assembly: System (in System.dll)
The following example shows how to check the value of the LocalizableAttribute for MyProperty. First, the code gets a PropertyDescriptorCollection with all the properties for the object. Then, the code gets MyProperty from the PropertyDescriptorCollection. Next, it returns the attributes for this property and saves them in the attributes variable.
Finally, the code sets myAttribute to the value of the LocalizableAttribute in the AttributeCollection and checks whether the property needs to be localized.
// Gets the attributes for the property. AttributeCollection^ attributes = TypeDescriptor::GetProperties( this )[ "MyProperty" ]->Attributes; // Checks to see if the property needs to be localized. LocalizableAttribute^ myAttribute = dynamic_cast<LocalizableAttribute^>(attributes[ LocalizableAttribute::typeid ]); if ( myAttribute->IsLocalizable ) { // Insert code here. }
.NET Framework
Available since 1.1
Available since 1.1
Show: