MergablePropertyAttribute.AllowMerge Proprietà

Definizione

Ottiene un valore che indica se questa proprietà può essere combinata con proprietà appartenenti ad altri oggetti in una finestra delle proprietà.

public bool AllowMerge { get; }

Valore della proprietà

true se questa proprietà può essere combinata con quelle appartenenti ad altri oggetti in una finestra delle proprietà, false in caso contrario.

Esempio

Nell'esempio seguente viene verificato se MyProperty è appropriato eseguire l'unione. Prima di tutto, il codice ottiene gli attributi per MyProperty per:

Il codice imposta myAttribute quindi sul valore di MergablePropertyAttribute in AttributeCollection e controlla se la proprietà è appropriata per l'unione.

// Gets the attributes for the property.
AttributeCollection attributes = 
   TypeDescriptor.GetProperties(this)["MyPropertyProperty"].Attributes;

// Checks to see if the property is bindable.
MergablePropertyAttribute myAttribute = (MergablePropertyAttribute)attributes[typeof(MergablePropertyAttribute)];
if(myAttribute.AllowMerge) {
   // Insert code here.
}

Si applica a

Prodotto Versioni
.NET Core 1.0, Core 1.1, 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

Vedi anche