BindingList<T> Constructors
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Initialiseert een nieuw exemplaar van de BindingList<T> klasse.
Overloads
| Name | Description |
|---|---|
| BindingList<T>() |
Initialiseert een nieuw exemplaar van de BindingList<T> klasse met behulp van standaardwaarden. |
| BindingList<T>(IList<T>) |
Initialiseert een nieuw exemplaar van de BindingList<T> klasse met de opgegeven lijst. |
BindingList<T>()
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
Initialiseert een nieuw exemplaar van de BindingList<T> klasse met behulp van standaardwaarden.
public:
BindingList();
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")]
public BindingList();
public BindingList();
Public Sub New ()
- Kenmerken
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u een nieuwe BindingList<T>maakt. Zie het overzichtsonderwerp van de klas voor het BindingList<T> volledige voorbeeld.
// Declare a new BindingListOfT with the Part business object.
BindingList<Part> listOfParts;
void InitializeListOfParts()
{
// Create the new BindingList of Part type.
listOfParts = new BindingList<Part>
{
// Allow new parts to be added, but not removed once committed.
AllowNew = true,
AllowRemove = false,
// Raise ListChanged events when new parts are added.
RaiseListChangedEvents = true,
// Do not allow parts to be edited.
AllowEdit = false
};
// Add a couple of parts to the list.
listOfParts.Add(new Part("Widget", 1234));
listOfParts.Add(new Part("Gadget", 5647));
}
' Declare a new BindingListOfT with the Part business object.
Private WithEvents listOfParts As BindingList(Of Part)
Private Sub InitializeListOfParts()
' Create the new BindingList of Part type.
listOfParts = New BindingList(Of Part)
' Allow new parts to be added, but not removed once committed.
listOfParts.AllowNew = True
listOfParts.AllowRemove = False
' Raise ListChanged events when new parts are added.
listOfParts.RaiseListChangedEvents = True
' Do not allow parts to be edited.
listOfParts.AllowEdit = False
' Add a couple of parts to the list.
listOfParts.Add(New Part("Widget", 1234))
listOfParts.Add(New Part("Gadget", 5647))
End Sub
Opmerkingen
In de volgende tabel ziet u initiële eigenschapswaarden voor een exemplaar van BindingList<T> klasse.
| Vastgoed | Initiële waarde |
|---|---|
| AllowEdit | true |
| AllowNew |
true als het lijsttype een parameterloze constructor heeft; anders, false. |
| AllowRemove | true |
| RaiseListChangedEvents | true |
Zie ook
Van toepassing op
BindingList<T>(IList<T>)
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
- Bron:
- BindingList.cs
Initialiseert een nieuw exemplaar van de BindingList<T> klasse met de opgegeven lijst.
public:
BindingList(System::Collections::Generic::IList<T> ^ list);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")]
public BindingList(System.Collections.Generic.IList<T> list);
public BindingList(System.Collections.Generic.IList<T> list);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")>]
new System.ComponentModel.BindingList<'T> : System.Collections.Generic.IList<'T> -> System.ComponentModel.BindingList<'T>
new System.ComponentModel.BindingList<'T> : System.Collections.Generic.IList<'T> -> System.ComponentModel.BindingList<'T>
Public Sub New (list As IList(Of T))
Parameters
- list
- IList<T>
Een IList<T> van de items die moeten worden opgenomen in de BindingList<T>.
- Kenmerken
Opmerkingen
Gebruik deze BindingList<T> optie om een BindingList<T> bestand te maken dat wordt ondersteund door list, zodat wijzigingen list worden doorgevoerd in de BindingList<T>.
In de volgende tabel ziet u initiële eigenschapswaarden voor een exemplaar van BindingList<T> klasse.
| Vastgoed | Initiële waarde |
|---|---|
| AllowEdit | true |
| AllowNew |
true als het lijsttype een parameterloze constructor heeft; anders, false. |
| AllowRemove | true |
| RaiseListChangedEvents | true |