AmbientValueAttribute Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy AmbientValueAttribute.

Przeciążenia

AmbientValueAttribute(Boolean)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę wartość logiczną dla jej wartości.

AmbientValueAttribute(Byte)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 8-bitową liczbę całkowitą bez znaku dla jej wartości.

AmbientValueAttribute(Char)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę znak Unicode dla jego wartości.

AmbientValueAttribute(Double)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę liczbę zmiennoprzecinkową o podwójnej precyzji dla jej wartości.

AmbientValueAttribute(Int16)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 16-bitową liczbę całkowitą ze znakiem dla jej wartości.

AmbientValueAttribute(Int32)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 32-bitową liczbę całkowitą ze znakiem dla jej wartości.

AmbientValueAttribute(Int64)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 64-bitową liczbę całkowitą ze znakiem dla jej wartości.

AmbientValueAttribute(Object)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę obiekt dla jego wartości.

AmbientValueAttribute(Single)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę liczbę zmiennoprzecinkową o pojedynczej precyzji dla jej wartości.

AmbientValueAttribute(String)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę ciąg dla jego wartości.

AmbientValueAttribute(Type, String)

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę wartość i jej typ.

AmbientValueAttribute(Boolean)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę wartość logiczną dla jej wartości.

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

Parametry

value
Boolean

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Byte)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 8-bitową liczbę całkowitą bez znaku dla jej wartości.

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

Parametry

value
Byte

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Char)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę znak Unicode dla jego wartości.

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

Parametry

value
Char

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Double)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę liczbę zmiennoprzecinkową o podwójnej precyzji dla jej wartości.

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

Parametry

value
Double

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Int16)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 16-bitową liczbę całkowitą ze znakiem dla jej wartości.

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

Parametry

value
Int16

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Int32)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 32-bitową liczbę całkowitą ze znakiem dla jej wartości.

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

Parametry

value
Int32

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Int64)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę 64-bitową liczbę całkowitą ze znakiem dla jej wartości.

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

Parametry

value
Int64

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Object)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę obiekt dla jego wartości.

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)

Parametry

value
Object

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Single)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę liczbę zmiennoprzecinkową o pojedynczej precyzji dla jej wartości.

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

Parametry

value
Single

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(String)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę ciąg dla jego wartości.

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)

Parametry

value
String

Wartość tego atrybutu.

Dotyczy

AmbientValueAttribute(Type, String)

Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs
Źródło:
AmbientValueAttribute.cs

Inicjuje AmbientValueAttribute nowe wystąpienie klasy, biorąc pod uwagę wartość i jej typ.

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)

Parametry

type
Type

Wartość Type parametru value .

value
String

Wartość tego atrybutu.

Przykłady

W poniższym przykładzie kodu pokazano użycie metody AmbientValueAttribute w celu wymuszenia zachowania otoczenia dla właściwości o nazwie AlertForeColor. Aby uzyskać pełną listę kodu, zobacz How to: Apply Attributes in Windows Forms Controls (Instrukcje: stosowanie atrybutów w kontrolkach 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

Dotyczy