CSharpTest.Net
CompareTo Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Data Namespace > DbGuid Structure : CompareTo Method

other

Glossary Item Box

Compares the current object with another object of the same type.

Syntax

Visual Basic (Declaration) 
Public Function CompareTo( _
   ByVal other As DbGuid _
) As Integer
C# 
public int CompareTo( 
   DbGuid other
)

Parameters

other

Example

Library/Library.Test/TestDbGuid.cs

C#Copy Code
DbGuid last = DbGuid.NewGuid();
for (int i = 0; i < 10000; i++)
{
    DbGuid test = DbGuid.NewGuid();
    TestSequence(last, test);
    TestSequence(last, test.ToSqlGuid());
    TestSequence(last.ToSqlGuid(), test);
    TestSequence(last.ToSqlGuid(), test.ToSqlGuid());
    Assert.IsTrue(last.CompareTo(test) < 0);
    last = test;
}
VB.NETCopy Code
Dim last As DbGuid = DbGuid.NewGuid()
Dim i As Integer = 0
While i < 10000
    Dim test As DbGuid = DbGuid.NewGuid()
    TestSequence(last, test)
    TestSequence(last, test.ToSqlGuid())
    TestSequence(last.ToSqlGuid(), test)
    TestSequence(last.ToSqlGuid(), test.ToSqlGuid())
    Assert.IsTrue(last.CompareTo(test) < 0)
    last = test
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys