AmbientValueAttribute 생성자

정의

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

오버로드

AmbientValueAttribute(Boolean)

해당 값에 대해 부울 값을 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Byte)

해당 값에 대해 8비트 부호 없는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Char)

해당 값에 대해 유니코드 문자를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Double)

해당 값에 대해 배정밀도 부동 소수점 숫자를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Int16)

해당 값에 대해 16비트 부호 있는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Int32)

해당 값에 대해 32비트 부호 있는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Int64)

해당 값에 대해 64비트 부호 있는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Object)

해당 값에 대해 개체를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Single)

해당 값에 대해 단정밀도 부동 소수점 숫자를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(String)

해당 값에 대해 문자열을 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Type, String)

값 및 형식을 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

AmbientValueAttribute(Boolean)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 부울 값을 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(bool value);
public AmbientValueAttribute (bool value);
new System.ComponentModel.AmbientValueAttribute : bool -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Boolean)

매개 변수

value
Boolean

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Byte)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 8비트 부호 없는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(System::Byte value);
public AmbientValueAttribute (byte value);
new System.ComponentModel.AmbientValueAttribute : byte -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Byte)

매개 변수

value
Byte

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Char)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 유니코드 문자를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(char value);
public AmbientValueAttribute (char value);
new System.ComponentModel.AmbientValueAttribute : char -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Char)

매개 변수

value
Char

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Double)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 배정밀도 부동 소수점 숫자를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(double value);
public AmbientValueAttribute (double value);
new System.ComponentModel.AmbientValueAttribute : double -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Double)

매개 변수

value
Double

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Int16)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 16비트 부호 있는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(short value);
public AmbientValueAttribute (short value);
new System.ComponentModel.AmbientValueAttribute : int16 -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Short)

매개 변수

value
Int16

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Int32)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 32비트 부호 있는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(int value);
public AmbientValueAttribute (int value);
new System.ComponentModel.AmbientValueAttribute : int -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Integer)

매개 변수

value
Int32

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Int64)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 64비트 부호 있는 정수를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(long value);
public AmbientValueAttribute (long value);
new System.ComponentModel.AmbientValueAttribute : int64 -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Long)

매개 변수

value
Int64

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Object)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 개체를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(System::Object ^ value);
public AmbientValueAttribute (object value);
public AmbientValueAttribute (object? value);
new System.ComponentModel.AmbientValueAttribute : obj -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Object)

매개 변수

value
Object

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Single)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 단정밀도 부동 소수점 숫자를 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(float value);
public AmbientValueAttribute (float value);
new System.ComponentModel.AmbientValueAttribute : single -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As Single)

매개 변수

value
Single

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(String)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

해당 값에 대해 문자열을 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(System::String ^ value);
public AmbientValueAttribute (string value);
public AmbientValueAttribute (string? value);
new System.ComponentModel.AmbientValueAttribute : string -> System.ComponentModel.AmbientValueAttribute
Public Sub New (value As String)

매개 변수

value
String

이 특성의 값입니다.

적용 대상

AmbientValueAttribute(Type, String)

Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs
Source:
AmbientValueAttribute.cs

값 및 형식을 지정하여 AmbientValueAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 AmbientValueAttribute(Type ^ type, System::String ^ value);
public AmbientValueAttribute (Type type, string value);
new System.ComponentModel.AmbientValueAttribute : Type * string -> System.ComponentModel.AmbientValueAttribute
Public Sub New (type As Type, value As String)

매개 변수

type
Type

value 매개 변수의 Type입니다.

value
String

이 특성의 값입니다.

예제

다음 코드 예제에서는 사용 하 여 AmbientValueAttribute 라는 AlertForeColor속성에 대 한 앰비언트 동작을 적용 하는 방법을 보여 줍니다. 전체 코드 목록은 참조 하세요 방법: Windows Forms 컨트롤에서 특성 적용합니다.

[AmbientValue(typeof(Color), "Empty")]
[Category("Appearance")]
[DefaultValue(typeof(Color), "White")]
[Description("The color used for painting alert text.")]
public Color AlertForeColor
{
    get
    {
        if (this.alertForeColorValue == Color.Empty &&
            this.Parent != null)
        {
            return Parent.ForeColor;
        }

        return this.alertForeColorValue;
    }

    set
    {
        this.alertForeColorValue = value;
    }
}

// This method is used by designers to enable resetting the
// property to its default value.
public void ResetAlertForeColor()
{
    this.AlertForeColor = AttributesDemoControl.defaultAlertForeColorValue;
}

// This method indicates to designers whether the property
// value is different from the ambient value, in which case
// the designer should persist the value.
private bool ShouldSerializeAlertForeColor()
{
    return (this.alertForeColorValue != AttributesDemoControl.ambientColorValue);
}
<AmbientValue(GetType(Color), "Empty"), _
Category("Appearance"), _
DefaultValue(GetType(Color), "White"), _
Description("The color used for painting alert text.")> _
Public Property AlertForeColor() As Color
    Get
        If Me.alertForeColorValue = Color.Empty AndAlso (Me.Parent IsNot Nothing) Then
            Return Parent.ForeColor
        End If

        Return Me.alertForeColorValue
    End Get

    Set(ByVal value As Color)
        Me.alertForeColorValue = value
    End Set
End Property

' This method is used by designers to enable resetting the
' property to its default value.
Public Sub ResetAlertForeColor()
    Me.AlertForeColor = AttributesDemoControl.defaultAlertForeColorValue
End Sub

' This method indicates to designers whether the property
' value is different from the ambient value, in which case
' the designer should persist the value.
Private Function ShouldSerializeAlertForeColor() As Boolean
    Return Me.alertForeColorValue <> AttributesDemoControl.ambientColorValue
End Function

적용 대상