LocalizableAttribute.IsLocalizable 속성

정의

속성을 지역화해야 하는지 여부를 나타내는 값을 가져옵니다.

public:
 property bool IsLocalizable { bool get(); };
public bool IsLocalizable { get; }
member this.IsLocalizable : bool
Public ReadOnly Property IsLocalizable As Boolean

속성 값

true속성을 지역화해야 하는 경우 그렇지 않으면 . false

예제

다음 예제에서는 forMyPropertyLocalizableAttribute 값을 확인하는 방법을 보여줍니다. 먼저 코드는 개체에 대한 모든 속성을 가진 a PropertyDescriptorCollection 를 가져옵니다. 그런 다음 코드는 .에서 PropertyDescriptorCollection가져옵니다MyProperty. 다음으로, 이 속성에 대한 특성을 반환하고 특성 변수에 저장합니다.

마지막으로 코드는 in AttributeCollectionLocalizableAttribute 값으로 설정하고 myAttribute 속성을 지역화해야 하는지 여부를 확인합니다.

// 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.
}
// 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 =
   (LocalizableAttribute)attributes[typeof(LocalizableAttribute)];
if (myAttribute.IsLocalizable)
{
    // Insert code here.
}
' Gets the attributes for the property.
Dim attributes As AttributeCollection = _
   TypeDescriptor.GetProperties(Me)("MyProperty").Attributes
       
' Checks to see if the property needs to be localized.
Dim myAttribute As LocalizableAttribute = _
   CType(attributes(GetType(LocalizableAttribute)), LocalizableAttribute)
   
If myAttribute.IsLocalizable Then
     ' Insert code here.
End If

적용 대상

추가 정보