LocalizableAttribute.IsLocalizable プロパティ
プロパティをローカライズする必要があるかどうかを示す値を取得します。
名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文

MyProperty の LocalizableAttribute の値を確認する方法の例を次に示します。最初に、オブジェクトのすべてのプロパティを保持する PropertyDescriptorCollection を取得します。次に、PropertyDescriptorCollection から MyProperty を取得します。そして、このプロパティの属性を返し、その属性を属性変数に保存します。
最後に、myAttribute を AttributeCollection にある LocalizableAttribute の値に設定し、プロパティをローカライズする必要があるかどうかを確認します。
' 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
// 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. 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).get_Item("MyProperty").get_Attributes(); // Checks to see if the property needs to be localized. LocalizableAttribute myAttribute = ((LocalizableAttribute) (attributes.get_Item(LocalizableAttribute.class.ToType()))); if (myAttribute.get_IsLocalizable()) { // Insert code here. }
// Gets the attributes for the property. var attributes : AttributeCollection = TypeDescriptor.GetProperties(this)["MyProperty"].Attributes // Checks to see if the property needs to be localized. var myAttribute : LocalizableAttribute = LocalizableAttribute(attributes(LocalizableAttribute)) if(myAttribute.IsLocalizable){ // Insert code here. }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からLocalizableAttribute.IsLocalizable プロパティを検索する場合は、下記のリンクをクリックしてください。

- LocalizableAttribute.IsLocalizable プロパティのページへのリンク