Click here to Skip to main content
11,479,162 members (61,362 online)
Click here to Skip to main content
Add your own
alternative version

NPerf, A Performance Benchmark Framework for .NET

, 25 Jan 2004 180.6K 514 140
NPerf is a framework for benchmarking classes and methods, that tastes like NUnit.
nperf_bin.zip
Release
NPerf.Cons.exe
NPerf.Core.dll
NPerf.Framework.chm
NPerf.Framework.dll
NPerf.Report.dll
scpl.dll
System.Perf.dll
nperf_demo.zip
Releases
Unpackaged
nperf-1.1-Release
nperf
bin
Release
nperf-doc-1.1.chm
NPerf.Cons.exe
NPerf.Core.dll
NPerf.Framework.dll
NPerf.Report.dll
scpl.dll
System.Perf.dll
nperf_src.zip
src
build
NAnt
i18n.xsl
ICSharpCode.SharpCvsLib.dll
ICSharpCode.SharpZipLib.dll
log4net.dll
NAnt.Contrib.Tasks.dll
NAnt.Core.dll
NAnt.DotNetTasks.dll
NAnt.exe
NAnt.NUnit.dll
NAnt.NUnit1Tasks.dll
NAnt.NUnit2ReportTasks.dll
NAnt.NUnit2Tasks.dll
NAnt.SourceControlTasks.dll
NAnt.VisualCppTasks.dll
NAnt.VSNetTasks.dll
NAnt.Win32Tasks.dll
NAnt.ZipTasks.dll
NDoc.Core.dll
NDoc.Documenter.Msdn.dll
NDoc.Documenter.NAnt.dll
NUnit-Frame.xsl
NUnit-NoFrame.xsl
nunit.framework.dll
NUnitCore.dll
toolkit.xsl
NPerf.Cons
Collections
App.ico
NPerf.Cons.cmbx
NPerf.Cons.prjx
NPerf.Core
Collections
Monitoring
Tracers
NPerf.Core.cmbx
NPerf.Core.prjx
NPerf.Framework
NPerf.Framework.cmbx
NPerf.Framework.prjx
NPerf.Report
scpl
scpl.dll
System.Perf
NPerf.Framework.chm
nperf.ndoc
nperf.png
using System;

namespace NPerf.Core.Collections
{
	/// <summary>
	/// A collection of elements of type PerfFailedResult
	/// </summary>
	public class PerfFailedResultCollection: System.Collections.CollectionBase
	{
		/// <summary>
		/// Initializes a new empty instance of the PerfFailedResultCollection class.
		/// </summary>
		public PerfFailedResultCollection()
		{
			// empty
		}

		/// <summary>
		/// Initializes a new instance of the PerfFailedResultCollection class, containing elements
		/// copied from an array.
		/// </summary>
		/// <param name="items">
		/// The array whose elements are to be added to the new PerfFailedResultCollection.
		/// </param>
		public PerfFailedResultCollection(PerfFailedResult[] items)
		{
			this.AddRange(items);
		}

		/// <summary>
		/// Initializes a new instance of the PerfFailedResultCollection class, containing elements
		/// copied from another instance of PerfFailedResultCollection
		/// </summary>
		/// <param name="items">
		/// The PerfFailedResultCollection whose elements are to be added to the new PerfFailedResultCollection.
		/// </param>
		public PerfFailedResultCollection(PerfFailedResultCollection items)
		{
			this.AddRange(items);
		}

		/// <summary>
		/// Adds the elements of an array to the end of this PerfFailedResultCollection.
		/// </summary>
		/// <param name="items">
		/// The array whose elements are to be added to the end of this PerfFailedResultCollection.
		/// </param>
		public virtual void AddRange(PerfFailedResult[] items)
		{
			foreach (PerfFailedResult item in items)
			{
				this.List.Add(item);
			}
		}

		/// <summary>
		/// Adds the elements of another PerfFailedResultCollection to the end of this PerfFailedResultCollection.
		/// </summary>
		/// <param name="items">
		/// The PerfFailedResultCollection whose elements are to be added to the end of this PerfFailedResultCollection.
		/// </param>
		public virtual void AddRange(PerfFailedResultCollection items)
		{
			foreach (PerfFailedResult item in items)
			{
				this.List.Add(item);
			}
		}

		/// <summary>
		/// Adds an instance of type PerfFailedResult to the end of this PerfFailedResultCollection.
		/// </summary>
		/// <param name="value">
		/// The PerfFailedResult to be added to the end of this PerfFailedResultCollection.
		/// </param>
		public virtual void Add(PerfFailedResult value)
		{
			this.List.Add(value);
		}

		/// <summary>
		/// Determines whether a specfic PerfFailedResult value is in this PerfFailedResultCollection.
		/// </summary>
		/// <param name="value">
		/// The PerfFailedResult value to locate in this PerfFailedResultCollection.
		/// </param>
		/// <returns>
		/// true if value is found in this PerfFailedResultCollection;
		/// false otherwise.
		/// </returns>
		public virtual bool Contains(PerfFailedResult value)
		{
			return this.List.Contains(value);
		}

		/// <summary>
		/// Return the zero-based index of the first occurrence of a specific value
		/// in this PerfFailedResultCollection
		/// </summary>
		/// <param name="value">
		/// The PerfFailedResult value to locate in the PerfFailedResultCollection.
		/// </param>
		/// <returns>
		/// The zero-based index of the first occurrence of the _ELEMENT value if found;
		/// -1 otherwise.
		/// </returns>
		public virtual int IndexOf(PerfFailedResult value)
		{
			return this.List.IndexOf(value);
		}

		/// <summary>
		/// Inserts an element into the PerfFailedResultCollection at the specified index
		/// </summary>
		/// <param name="index">
		/// The index at which the PerfFailedResult is to be inserted.
		/// </param>
		/// <param name="value">
		/// The PerfFailedResult to insert.
		/// </param>
		public virtual void Insert(int index, PerfFailedResult value)
		{
			this.List.Insert(index, value);
		}

		/// <summary>
		/// Gets or sets the PerfFailedResult at the given index in this PerfFailedResultCollection.
		/// </summary>
		public virtual PerfFailedResult this[int index]
		{
			get
			{
				return (PerfFailedResult) this.List[index];
			}
			set
			{
				this.List[index] = value;
			}
		}

		/// <summary>
		/// Removes the first occurrence of a specific PerfFailedResult from this PerfFailedResultCollection.
		/// </summary>
		/// <param name="value">
		/// The PerfFailedResult value to remove from this PerfFailedResultCollection.
		/// </param>
		public virtual void Remove(PerfFailedResult value)
		{
			this.List.Remove(value);
		}

		/// <summary>
		/// Type-specific enumeration class, used by PerfFailedResultCollection.GetEnumerator.
		/// </summary>
		public class Enumerator: System.Collections.IEnumerator
		{
			private System.Collections.IEnumerator wrapped;

			public Enumerator(PerfFailedResultCollection collection)
			{
				this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
			}

			public PerfFailedResult Current
			{
				get
				{
					return (PerfFailedResult) (this.wrapped.Current);
				}
			}

			object System.Collections.IEnumerator.Current
			{
				get
				{
					return (PerfFailedResult) (this.wrapped.Current);
				}
			}

			public bool MoveNext()
			{
				return this.wrapped.MoveNext();
			}

			public void Reset()
			{
				this.wrapped.Reset();
			}
		}

		/// <summary>
		/// Returns an enumerator that can iterate through the elements of this PerfFailedResultCollection.
		/// </summary>
		/// <returns>
		/// An object that implements System.Collections.IEnumerator.
		/// </returns>        
		public new virtual PerfFailedResultCollection.Enumerator GetEnumerator()
		{
			return new PerfFailedResultCollection.Enumerator(this);
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jonathan de Halleux
Engineer
United States United States
Jonathan de Halleux is Civil Engineer in Applied Mathematics. He finished his PhD in 2004 in the rainy country of Belgium. After 2 years in the Common Language Runtime (i.e. .net), he is now working at Microsoft Research on Pex (http://research.microsoft.com/pex).

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 26 Jan 2004
Article Copyright 2004 by Jonathan de Halleux
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid