CSharpTest.Net
BTreeList<T> Constructor(IComparer<T>,IEnumerable<T>)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > BTreeList<T> Class > BTreeList<T> Constructor : BTreeList<T> Constructor(IComparer<T>,IEnumerable<T>)

comparer
copyFrom

Glossary Item Box

Constructs a BTreeList instance.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal comparer As IComparer(Of T), _
   ByVal copyFrom As IEnumerable(Of T) _
)
C# 
public BTreeList<T>( 
   IComparer<T> comparer,
   IEnumerable<T> copyFrom
)

Parameters

comparer
copyFrom

Example

Library/Library.Test/TestBTreeList.cs

C#Copy Code
BTreeList<int> data = new BTreeList<int>(Comparer, GetSample());
Assert.IsFalse(data.IsReadOnly);
            
BTreeList<int> copy = data.MakeReadOnly();
Assert.IsFalse(ReferenceEquals(data, copy));
Assert.AreEqual(data.Count, copy.Count);
Assert.IsTrue(copy.IsReadOnly);

Assert.IsTrue(ReferenceEquals(copy, copy.MakeReadOnly()));
data = copy.Clone();
Assert.IsFalse(data.IsReadOnly);
Assert.IsFalse(ReferenceEquals(copy, data));
Assert.AreEqual(data.Count, copy.Count);
VB.NETCopy Code
Dim data As New BTreeList(Of Integer)(Comparer, GetSample())
Assert.IsFalse(data.IsReadOnly)

Dim copy As BTreeList(Of Integer) = data.MakeReadOnly()
Assert.IsFalse(ReferenceEquals(data, copy))
Assert.AreEqual(data.Count, copy.Count)
Assert.IsTrue(copy.IsReadOnly)

Assert.IsTrue(ReferenceEquals(copy, copy.MakeReadOnly()))
data = copy.Clone()
Assert.IsFalse(data.IsReadOnly)
Assert.IsFalse(ReferenceEquals(copy, data))
Assert.AreEqual(data.Count, copy.Count)

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys