[This is preliminary documentation and is subject to change.]

Adds a new item to the list.

Namespace: Tools.CollectionsT.GenericT
Assembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public virtual T AddNew()
Visual Basic
Public Overridable Function AddNew As T
Visual C++
public:
virtual T AddNew()
F#
abstract AddNew : unit -> 'T 
override AddNew : unit -> 'T 
JScript
public function AddNew() : T

Return Value

The item added to the list.

Remarks

This member implements AddNew()()()()

Exceptions

ExceptionCondition
System..::..NotSupportedExceptionAllowNew is false.
System..::..ArgumentExceptionT is not a RuntimeType. -or- T is an open generic type (that is, the ContainsGenericParameters property returns true).
System..::..NotSupportedExceptionT cannot be a TypeBuilder. -or- Creation of TypedReference, ArgIterator, Void, and RuntimeArgumentHandle types, or arrays of those types, is not supported.
System.Reflection..::..TargetInvocationExceptionThe constructor of T being called throws an exception.
System..::..MethodAccessExceptionThe caller does not have permission to call defualt constructor of T.
System..::..MemberAccessExceptionCannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism.
System.Runtime.InteropServices..::..InvalidComObjectExceptionThe COM type was not obtained through Overload:GetTypeFromProgID(String) or Overload:GetTypeFromCLSID(Guid).
System..::..MissingMethodExceptionNo matching public constructor was found.
System.Runtime.InteropServices..::..COMExceptionT is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered.
System..::..InvalidOperationExceptionLocked is True
System..::..OperationCanceledExceptionOperation is canceled in eventhandler and CancelError is true
System..::..ExceptionAny Exception can be thrown by event handler of the Adding event -or- Any excption may be thrown by OnAdding(ICollection, Nullable<(Of <<'(Int32>)>>), Boolean) when AllowItemCancel is true.

See Also