RecommendedAsConfigurableAttribute 클래스

정의

주의

Use System.ComponentModel.SettingsBindableAttribute instead to work with the new settings model.

주의

RecommendedAsConfigurableAttribute has been deprecated. Use System.ComponentModel.SettingsBindableAttribute instead.

속성을 애플리케이션 설정으로 사용할 수 있도록 지정합니다.

public ref class RecommendedAsConfigurableAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Property)]
[System.Obsolete("Use System.ComponentModel.SettingsBindableAttribute instead to work with the new settings model.")]
public class RecommendedAsConfigurableAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Property)]
public class RecommendedAsConfigurableAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Property)]
[System.Obsolete("RecommendedAsConfigurableAttribute has been deprecated. Use System.ComponentModel.SettingsBindableAttribute instead.")]
public class RecommendedAsConfigurableAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Property)>]
[<System.Obsolete("Use System.ComponentModel.SettingsBindableAttribute instead to work with the new settings model.")>]
type RecommendedAsConfigurableAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Property)>]
type RecommendedAsConfigurableAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Property)>]
[<System.Obsolete("RecommendedAsConfigurableAttribute has been deprecated. Use System.ComponentModel.SettingsBindableAttribute instead.")>]
type RecommendedAsConfigurableAttribute = class
    inherit Attribute
Public Class RecommendedAsConfigurableAttribute
Inherits Attribute
상속
RecommendedAsConfigurableAttribute
특성

예제

다음 예제에서는 애플리케이션 설정으로 사용 가능한 것으로 속성을 표시합니다.

public:
   [RecommendedAsConfigurable(true)]
   property int MyProperty 
   {
      int get()
      {
         // Insert code here.
         return 0;
      }
      void set( int /*value*/ )
      {
         // Insert code here.
      }
   }
[RecommendedAsConfigurable(true)]
 public int MyProperty {
    get {
       // Insert code here.
       return 0;
    }
    set {
       // Insert code here.
    }
 }
<RecommendedAsConfigurable(True)> _
Public Property MyProperty() As Integer
    Get
        ' Insert code here.
        Return 0
    End Get
    Set
        ' Insert code here.
    End Set 
End Property

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

이 예제에서는 의 값을 RecommendedAsConfigurableAttribute확인하는 두 가지 방법을 제공합니다. 두 번째 코드 조각에서 예제는 메서드를 호출합니다 Equals . 마지막 코드 조각에서 사용 하 여는 RecommendedAsConfigurable 속성 값을 확인 합니다.

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

// Checks to see if the value of the RecommendedAsConfigurableAttribute is Yes.
if ( attributes[ RecommendedAsConfigurableAttribute::typeid ]->Equals( RecommendedAsConfigurableAttribute::Yes ) )
{
   // Insert code here.
}

// This is another way to see if the property is recommended as configurable.
RecommendedAsConfigurableAttribute^ myAttribute = dynamic_cast<RecommendedAsConfigurableAttribute^>(attributes[ RecommendedAsConfigurableAttribute::typeid ]);
if ( myAttribute->RecommendedAsConfigurable )
{
   // Insert code here.
}
// Gets the attributes for the property.
AttributeCollection attributes = 
   TypeDescriptor.GetProperties(this)["MyProperty"].Attributes;
 
// Checks to see if the value of the RecommendedAsConfigurableAttribute is Yes.
if(attributes[typeof(RecommendedAsConfigurableAttribute)].Equals(RecommendedAsConfigurableAttribute.Yes)) {
   // Insert code here.
}
 
// This is another way to see if the property is recommended as configurable.
RecommendedAsConfigurableAttribute myAttribute = 
   (RecommendedAsConfigurableAttribute)attributes[typeof(RecommendedAsConfigurableAttribute)];
if(myAttribute.RecommendedAsConfigurable) {
   // Insert code here.
}
' Gets the attributes for the property.
Dim attributes As AttributeCollection = TypeDescriptor.GetProperties(Me)("MyProperty").Attributes

' Checks to see if the value of the RecommendedAsConfigurableAttribute is Yes.
If attributes(GetType(RecommendedAsConfigurableAttribute)).Equals(RecommendedAsConfigurableAttribute.Yes) Then
    ' Insert code here.
End If 

' This is another way to see if the property is recommended as configurable.
Dim myAttribute As RecommendedAsConfigurableAttribute = _
    CType(attributes(GetType(RecommendedAsConfigurableAttribute)), RecommendedAsConfigurableAttribute)
If myAttribute.RecommendedAsConfigurable Then
    ' Insert code here.
End If

사용 하 여 클래스를 표시 하는 경우는 RecommendedAsConfigurableAttribute, 값을 확인 하려면 다음 코드를 사용 합니다.

AttributeCollection^ attributes = TypeDescriptor::GetAttributes( MyProperty );
if ( attributes[ RecommendedAsConfigurableAttribute::typeid ]->Equals( RecommendedAsConfigurableAttribute::Yes ) )
{
   // Insert code here.
}
AttributeCollection attributes = 
   TypeDescriptor.GetAttributes(MyProperty);
if(attributes[typeof(RecommendedAsConfigurableAttribute)].Equals(RecommendedAsConfigurableAttribute.Yes)) {
   // Insert code here.
}
Dim attributes As AttributeCollection = TypeDescriptor.GetAttributes(MyProperty)
If attributes(GetType(RecommendedAsConfigurableAttribute)).Equals(RecommendedAsConfigurableAttribute.Yes) Then
    ' Insert code here.
End If

설명

속성 창에서 RecommendedAsConfigurableAttributeConfigurableProperties 줄을 확장할 때 표시할 true 집합으로 표시된 속성입니다. 권장 되는 설정이 없는 했거나이 사용 하 여 표시 되는 속성을 RecommendedAsConfigurableAttributefalse 애플리케이션 설정 중인 가급적 이며 표시 되지 않습니다. 기본값은 false입니다.

속성 창의 RecommendedAsConfigurableAttribute 설정에서 줄임표 단추(...)를 클릭하고 목록에서 적절한 속성을 선택하여 Visual Studio의 설정에 없는 속성을 바인딩할 수 있습니다.

참고

로 설정된 true속성을 RecommendedAsConfigurableAttribute 표시하면 이 특성의 값이 상수 멤버 Yes로 설정됩니다. 값false으로 RecommendedAsConfigurableAttribute 설정된 로 표시된 속성의 경우 값은 입니다No. 따라서 코드에서이 특성의 값을 확인 하려는 경우 특성으로 지정 해야 합니다 RecommendedAsConfigurableAttribute.Yes 또는 RecommendedAsConfigurableAttribute.No합니다.

자세한 내용은 특성을 참조하세요.

.

생성자

RecommendedAsConfigurableAttribute(Boolean)
사용되지 않음.
사용되지 않음.

RecommendedAsConfigurableAttribute 클래스의 새 인스턴스를 초기화합니다.

필드

Default
사용되지 않음.
사용되지 않음.

RecommendedAsConfigurableAttribute의 기본값인 No을 지정합니다. 이 static 필드는 읽기 전용입니다.

No
사용되지 않음.
사용되지 않음.

속성을 애플리케이션 설정으로 사용할 수 없도록 지정합니다. 이 static 필드는 읽기 전용입니다.

Yes
사용되지 않음.
사용되지 않음.

속성을 애플리케이션 설정으로 사용할 수 있도록 지정합니다. 이 static 필드는 읽기 전용입니다.

속성

RecommendedAsConfigurable
사용되지 않음.
사용되지 않음.

이 특성이 바인딩되는 속성을 애플리케이션 설정으로 사용할 수 있는지 여부를 나타내는 값을 가져옵니다.

TypeId
사용되지 않음.
사용되지 않음.

파생 클래스에서 구현된 경우 이 Attribute에 대한 고유 식별자를 가져옵니다.

(다음에서 상속됨 Attribute)

메서드

Equals(Object)
사용되지 않음.
사용되지 않음.

이 인스턴스와 지정된 개체가 같은지 여부를 나타냅니다.

GetHashCode()
사용되지 않음.
사용되지 않음.

이 인스턴스의 해시 코드를 반환합니다.

GetType()
사용되지 않음.
사용되지 않음.

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IsDefaultAttribute()
사용되지 않음.
사용되지 않음.

이 인스턴스의 값이 클래스의 기본값인지 여부를 나타냅니다.

Match(Object)
사용되지 않음.
사용되지 않음.

파생 클래스에서 재정의된 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Attribute)
MemberwiseClone()
사용되지 않음.
사용되지 않음.

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()
사용되지 않음.
사용되지 않음.

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
사용되지 않음.
사용되지 않음.

이름 집합을 해당하는 디스패치 식별자 집합에 매핑합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
사용되지 않음.
사용되지 않음.

인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfoCount(UInt32)
사용되지 않음.
사용되지 않음.

개체에서 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1).

(다음에서 상속됨 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
사용되지 않음.
사용되지 않음.

개체에서 노출하는 메서드와 속성에 대한 액세스를 제공합니다.

(다음에서 상속됨 Attribute)

적용 대상

추가 정보