Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

LocalizableAttribute::IsLocalizable Property

 

Gets a value indicating whether a property should be localized.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public:
property bool IsLocalizable {
	bool get();
}

Property Value

Type: System::Boolean

true if a property should be localized; otherwise, false.

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
Return to top
Show:
© 2017 Microsoft