CSharpTest.Net
Add Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > OrdinalList Class : Add Method

item

Glossary Item Box

Adds an integer ordinal into the collection

Syntax

Visual Basic (Declaration) 
Public Sub Add( _
   ByVal item As Integer _
) 
C# 
public void Add( 
   int item
)

Parameters

item

Example

Library/Library.Test/TestOrdinalList.cs

C#Copy Code
OrdinalList lista = new OrdinalList(new int[] { 0 });
OrdinalList listb = (OrdinalList) ((ICloneable) lista).Clone();
Assert.IsFalse(ReferenceEquals(lista, listb));
Assert.AreEqual(lista.Count, listb.Count);
Assert.IsTrue(listb.Contains(0));

listb.Add(1);
Assert.IsTrue(listb.Contains(1));
Assert.IsFalse(lista.Contains(1));
VB.NETCopy Code
Dim lista As New OrdinalList(New Integer() {0})
Dim listb As OrdinalList = DirectCast((DirectCast(lista, ICloneable)).Clone(), OrdinalList)
Assert.IsFalse(ReferenceEquals(lista, listb))
Assert.AreEqual(lista.Count, listb.Count)
Assert.IsTrue(listb.Contains(0))

listb.Add(1)
Assert.IsTrue(listb.Contains(1))
Assert.IsFalse(lista.Contains(1))

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys