AddingNewEventArgs Constructors

Definition

Initializes a new instance of the AddingNewEventArgs class.

Overloads

AddingNewEventArgs()

Initializes a new instance of the AddingNewEventArgs class using no parameters.

AddingNewEventArgs(Object)

Initializes a new instance of the AddingNewEventArgs class using the specified object as the new item.

AddingNewEventArgs()

Source:
AddingNewEventArgs.cs
Source:
AddingNewEventArgs.cs
Source:
AddingNewEventArgs.cs

Initializes a new instance of the AddingNewEventArgs class using no parameters.

C#
public AddingNewEventArgs();

Remarks

The parameterless constructor sets the NewObject property to null. A value that is null indicates that, if the AddingNewEventHandler does not explicitly set this property, the collection will take standard steps to provide a new item to add to itself.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 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

AddingNewEventArgs(Object)

Source:
AddingNewEventArgs.cs
Source:
AddingNewEventArgs.cs
Source:
AddingNewEventArgs.cs

Initializes a new instance of the AddingNewEventArgs class using the specified object as the new item.

C#
public AddingNewEventArgs(object? newObject);
C#
public AddingNewEventArgs(object newObject);

Parameters

newObject
Object

An Object to use as the new item value.

Remarks

The AddingNewEventArgs constructor sets the NewObject property to the newObject parameter. This object will be used as the new item to be added to the associated collection, unless this property is updated by the event handler.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 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