CSharpTest.Net
LurchTable<TKey,TValue> Constructor(LurchTableOrder,Int32)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > LurchTable<TKey,TValue> Class > LurchTable<TKey,TValue> Constructor : LurchTable<TKey,TValue> Constructor(LurchTableOrder,Int32)

ordering
limit

Glossary Item Box

Creates a LurchTable that orders items by (ordering) and removes items once the specified (limit) is reached.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal ordering As LurchTableOrder, _
   ByVal limit As Integer _
)
C# 
public LurchTable<TKey,TValue>( 
   LurchTableOrder ordering,
   int limit
)

Parameters

ordering
limit

Example

Library/Library.Test/TestLurchTable.cs

C#Copy Code
var cmp = new IntComparer();
const int limit = 5;

Assert.AreEqual(LurchTableOrder.None, new LurchTable<int, int>(1).Ordering);
Assert.AreEqual(LurchTableOrder.Insertion, new LurchTable<int, int>(1, LurchTableOrder.Insertion).Ordering);
Assert.IsTrue(ReferenceEquals(cmp, new LurchTable<int, int>(1, LurchTableOrder.Insertion, cmp).Comparer));
Assert.AreEqual(LurchTableOrder.Modified, new LurchTable<int, int>(LurchTableOrder.Modified, limit).Ordering);
Assert.AreEqual(limit, new LurchTable<int, int>(LurchTableOrder.Modified, limit).Limit);
Assert.AreEqual(LurchTableOrder.Access, new LurchTable<int, int>(LurchTableOrder.Access, limit, cmp).Ordering);
Assert.AreEqual(limit, new LurchTable<int, int>(LurchTableOrder.Access, limit, cmp).Limit);
Assert.IsTrue(ReferenceEquals(cmp, new LurchTable<int, int>(LurchTableOrder.Access, limit, cmp).Comparer));
Assert.AreEqual(LurchTableOrder.Access, new LurchTable<int, int>(LurchTableOrder.Access, limit, 1, 1, 1, cmp).Ordering);
Assert.AreEqual(limit, new LurchTable<int, int>(LurchTableOrder.Access, limit, 1, 1, 1, cmp).Limit);
Assert.IsTrue(ReferenceEquals(cmp, new LurchTable<int, int>(LurchTableOrder.Access, limit, 1, 1, 1, cmp).Comparer));
VB.NETCopy Code
Dim cmp As var = New IntComparer()
Const  limit As Integer = 5

Assert.AreEqual(LurchTableOrder.None, New LurchTable(Of Integer, Integer)(1).Ordering)
Assert.AreEqual(LurchTableOrder.Insertion, New LurchTable(Of Integer, Integer)(1, LurchTableOrder.Insertion).Ordering)
Assert.IsTrue(ReferenceEquals(cmp, New LurchTable(Of Integer, Integer)(1, LurchTableOrder.Insertion, cmp).Comparer))
Assert.AreEqual(LurchTableOrder.Modified, New LurchTable(Of Integer, Integer)(LurchTableOrder.Modified, limit).Ordering)
Assert.AreEqual(limit, New LurchTable(Of Integer, Integer)(LurchTableOrder.Modified, limit).Limit)
Assert.AreEqual(LurchTableOrder.Access, New LurchTable(Of Integer, Integer)(LurchTableOrder.Access, limit, cmp).Ordering)
Assert.AreEqual(limit, New LurchTable(Of Integer, Integer)(LurchTableOrder.Access, limit, cmp).Limit)
Assert.IsTrue(ReferenceEquals(cmp, New LurchTable(Of Integer, Integer)(LurchTableOrder.Access, limit, cmp).Comparer))
Assert.AreEqual(LurchTableOrder.Access, New LurchTable(Of Integer, Integer)(LurchTableOrder.Access, limit, 1, 1, 1, cmp).Ordering)
Assert.AreEqual(limit, New LurchTable(Of Integer, Integer)(LurchTableOrder.Access, limit, 1, 1, 1, cmp).Limit)
Assert.IsTrue(ReferenceEquals(cmp, New LurchTable(Of Integer, Integer)(LurchTableOrder.Access, limit, 1, 1, 1, cmp).Comparer))

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys