Click or drag to resize

ExtensionMethodsTryAddAtFirstNullT Method

Attempts to add an item to an array in the first spot it can find that's null.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static bool TryAddAtFirstNull<T>(
	this T[] array,
	T itemToAdd,
	bool searchInReverseOrder = false
)

Parameters

array
Type: T
The array to add an item to
itemToAdd
Type: T
The item to add to the array, if possible
searchInReverseOrder (Optional)
Type: SystemBoolean
Whether or not to search starting from the end, defaulted to false

Type Parameters

T
The type of array

Return Value

Type: Boolean
True if the item was added to the array

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also