AmbientValueAttribute コンストラクター

定義

AmbientValueAttribute クラスの新しいインスタンスを初期化します。

オーバーロード

AmbientValueAttribute(Boolean)

値としてブール値を指定して、AmbientValueAttribute クラスの新しいインスタンスを初期化します。

AmbientValueAttribute(Byte)

値として 8 ビット符号なし整数を指定して、AmbientValueAttribute クラスの新しいインスタンスを初期化します。

AmbientValueAttribute(Char)

値として Unicode 文字を指定して、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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs

値として Unicode 文字を指定して、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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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)

ソース:
AmbientValueAttribute.cs
ソース:
AmbientValueAttribute.cs
ソース:
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 フォーム コントロールで属性を適用する」を参照してください。

[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

適用対象