BrowsableAttribute.Browsable 속성

정의

찾아볼 수 있는 개체인지 여부를 나타내는 값을 가져옵니다.

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

속성 값

검색 가능 개체이면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 가 검색 가능한지 여부를 MyProperty 확인합니다. 먼저 코드에 대 한 특성을 가져옵니다 MyProperty 여:

그런 다음 코드는 의 값을 BrowsableAttributeAttributeCollection 로 설정하고 myAttribute 속성을 검색할 수 있는지 여부를 확인합니다.

// Gets the attributes for the property.
AttributeCollection^ attributes = TypeDescriptor::GetProperties( this )[ "MyProperty" ]->Attributes;

// Checks to see if the property is browsable.
BrowsableAttribute^ myAttribute = dynamic_cast<BrowsableAttribute^>(attributes[ BrowsableAttribute::typeid ]);
if ( myAttribute->Browsable )
{
   // Insert code here.
}
// Gets the attributes for the property.
 AttributeCollection attributes = 
    TypeDescriptor.GetProperties(this)["MyProperty"].Attributes;
 
 // Checks to see if the property is browsable.
 BrowsableAttribute myAttribute = (BrowsableAttribute)attributes[typeof(BrowsableAttribute)];
 if(myAttribute.Browsable) {
    // Insert code here.
 }
' Gets the attributes for the property.
Dim attributes As AttributeCollection = TypeDescriptor.GetProperties(Me)("MyProperty").Attributes

' Checks to see if the property is browsable.
Dim myAttribute As BrowsableAttribute = CType(attributes(GetType(BrowsableAttribute)), BrowsableAttribute)
If myAttribute.Browsable Then
    ' Insert code here.
End If

적용 대상

추가 정보