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.

C#
public AmbientValueAttribute (bool value);

Parametry

value
Boolean

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (byte value);

Parametry

value
Byte

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (char value);

Parametry

value
Char

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (double value);

Parametry

value
Double

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (short value);

Parametry

value
Int16

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (int value);

Parametry

value
Int32

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (long value);

Parametry

value
Int64

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (object value);
C#
public AmbientValueAttribute (object? value);

Parametry

value
Object

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (float value);

Parametry

value
Single

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (string value);
C#
public AmbientValueAttribute (string? value);

Parametry

value
String

Wartość tego atrybutu.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

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.

C#
public AmbientValueAttribute (Type type, string value);

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).

C#
[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);
}

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1