CSharpTest.Net
GetEvents Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IpcChannel Namespace > IpcEventChannel Class : GetEvents Method

Glossary Item Box

Returns an enumeration of all known events of this instance

Syntax

Visual Basic (Declaration) 
Public Function GetEvents() As IEnumerable(Of IpcEvent)
C# 
public IEnumerable<IpcEvent> GetEvents()

Example

Library/Library.Test/TestIpcChannel.cs

C#Copy Code
using (IpcEventChannel channel = new IpcEventChannel(_registrar, _channel))
{
    Assert.AreEqual("Test", channel["Test"].LocalName);
    Assert.AreEqual("TEST", channel["TEST"].LocalName);
    Assert.AreEqual("test", channel["test"].LocalName);

    int count = 0;
    foreach (IpcEvent e in channel.GetEvents())
    {
        Assert.AreEqual("test", e.LocalName.ToLower());
        count++;
    }
    Assert.AreEqual(3, count);
}
VB.NETCopy Code
Using channel As New IpcEventChannel(_registrar, _channel)
    Assert.AreEqual("Test", channel("Test").LocalName)
    Assert.AreEqual("TEST", channel("TEST").LocalName)
    Assert.AreEqual("test", channel("test").LocalName)

    Dim count As Integer = 0
    For Each e As IpcEvent In channel.GetEvents()
        Assert.AreEqual("test", e.LocalName.ToLower())
        System.Math.Max(System.Threading.Interlocked.Increment(count),count - 1)
    Next
    Assert.AreEqual(3, count)
End Using

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys