CSharpTest.Net
UsageCounter Class
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Threading Namespace : UsageCounter Class

Glossary Item Box

Provides a counter that fires a delegate on first usage and last release. For the counts to be maintained someone must hold an instance of one or more of these objects.

Syntax

Visual Basic (Declaration) 
Public Class UsageCounter 
C# 
public class UsageCounter 

Example

Library/Library.Test/TestUsageCounter.cs

C#Copy Code
using (UsageCounter counter = new UsageCounter("some global name"))
    Assert.AreEqual("some global name", counter.Name);
using (UsageCounter counter = new UsageCounter(@"{0}\Item-{1}", "Global", 1))
    Assert.AreEqual(@"Global\Item-1", counter.Name);
VB.NETCopy Code
Using counter As New UsageCounter("some global name")
    Assert.AreEqual("some global name", counter.Name)
End Using
Using counter As New UsageCounter("{0}\Item-{1}", "Global", 1)
    Assert.AreEqual("Global\Item-1", counter.Name)
End Using

Inheritance Hierarchy

System.Object
   CSharpTest.Net.Threading.UsageCounter

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys