AmbientValueAttribute Oluşturucular

Tanım

AmbientValueAttribute sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

AmbientValueAttribute(Boolean)

Değeri için bir Boole değeri verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Byte)

Değeri için 8 bit işaretsiz bir tamsayı verildiğinde sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Char)

Değeri için bir Unicode karakteri verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Double)

Değeri için çift duyarlıklı kayan AmbientValueAttribute nokta sayısı verilip sınıfın yeni bir örneğini başlatır.

AmbientValueAttribute(Int16)

Değeri için 16 bit imzalı bir tamsayı verilip sınıfın yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Int32)

Değeri için 32 bit imzalı bir tamsayı verilip sınıfın yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Int64)

Değeri için 64 bit imzalı bir tamsayı verilip sınıfın yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Object)

Değeri için bir nesne verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Single)

Değeri için tek duyarlıklı kayan AmbientValueAttribute nokta sayısı verilip sınıfın yeni bir örneğini başlatır.

AmbientValueAttribute(String)

Değeri için bir dize verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Type, String)

değeri ve türü göz önünde bulundurularak sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

AmbientValueAttribute(Boolean)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için bir Boole değeri verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

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

Parametreler

value
Boolean

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Byte)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için 8 bit işaretsiz bir tamsayı verildiğinde sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

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

Parametreler

value
Byte

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Char)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için bir Unicode karakteri verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

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

Parametreler

value
Char

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Double)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için çift duyarlıklı kayan AmbientValueAttribute nokta sayısı verilip sınıfın yeni bir örneğini başlatır.

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

Parametreler

value
Double

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Int16)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için 16 bit imzalı bir tamsayı verilip sınıfın yeni bir örneğini AmbientValueAttribute başlatır.

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

Parametreler

value
Int16

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Int32)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için 32 bit imzalı bir tamsayı verilip sınıfın yeni bir örneğini AmbientValueAttribute başlatır.

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

Parametreler

value
Int32

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Int64)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için 64 bit imzalı bir tamsayı verilip sınıfın yeni bir örneğini AmbientValueAttribute başlatır.

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

Parametreler

value
Int64

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Object)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için bir nesne verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

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)

Parametreler

value
Object

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Single)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için tek duyarlıklı kayan AmbientValueAttribute nokta sayısı verilip sınıfın yeni bir örneğini başlatır.

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

Parametreler

value
Single

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(String)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

Değeri için bir dize verilip sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

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)

Parametreler

value
String

Bu özniteliğin değeri.

Şunlara uygulanır

AmbientValueAttribute(Type, String)

Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs
Kaynak:
AmbientValueAttribute.cs

değeri ve türü göz önünde bulundurularak sınıfının yeni bir örneğini AmbientValueAttribute başlatır.

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)

Parametreler

type
Type

Type parametresininvalue.

value
String

Bu özniteliğin değeri.

Örnekler

Aşağıdaki kod örneğinde adlı AlertForeColorbir özellik için ortam davranışını zorlamak için kullanma AmbientValueAttribute gösterilmektedir. Tam kod listesi için bkz. Nasıl yapılır: Windows Forms Denetimlerinde Öznitelikleri Uygulama.

[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

Şunlara uygulanır