Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

NTime - Performance unit testing tool

, 30 Mar 2006
An article on a performance testing tool to test an application against its performance.
ntime_demo.zip
Installer
1.1
NTimeSetup.msi
Setup.Exe
Setup.Ini
2.0
NTimeSetup.msi
setup.exe
ntime_sdk.zip
NTime Framework SDK Documentation.chm
ntime_src.zip
src
Framework
License.rtf
ntime.snk
NTimeConsole
App.ico
NTimeGUI
folder.bmp
folder2.bmp
gray.bmp
green.bmp
NTime.ico
red.bmp
yellow.bmp
NTimeSetup
NTimeSetup.vdproj
PerformanceTests
Readme.rtf
ntime_src_11.zip
NTime_src_1.1
Framework
.VPUML
.history
.historyinfo_NTime.Framework.dll
NTime.Framework.dll.vpp.v1
NTime.Framework.dll.vpp
bin
Release
NTime.Framework.dll
ModelSupport
default.txvpck
NTime
Framework
Framework.txvpck
NTime.txvpck
mssccprj.scc
NTime.Framework
NTime.Framework.dll.csproj.user
NTime.Framework.dll.csproj.vspscc
vssver.scc
ntime.snk
NTimeAddin
bin
Release
NTimeAddin.dll
NTimeAddin.tlb
NTimeAddin.csproj.user
NTimeAddinSetup
NTimeAddinSetup.vdproj
NTimeConsole
App.ico
bin
Release
NTime.exe
NTimeConsole.exe
ModelSupport
mssccprj.scc
NTime.csproj.user
NTime.csproj.vspscc
vssver.scc
NTimeGUI
.VPUML
.history
.historyinfo_NTimeGUI
NTimeGUI.vpp.v1
NTimeGUI.vpp
bin
Release
NTimeGUI.exe
folder.bmp
folder2.bmp
gray.bmp
green.bmp
ModelSupport
default.txvpck
NTime
GUI
GUI.txvpck
NTime.txvpck
mssccprj.scc
NTime.ico
NTimeGUI.csproj.user
NTimeGUI.csproj.vspscc
out
doc
doc-files
default.gif
gendoc.gdc
model-tree
false.gif
model.tree
ST_Attribute.gif
ST_Class Diagram.gif
ST_Class.gif
ST_Operation.gif
ST_Package Diagram.gif
ST_Package.gif
ST_Project.gif
true.gif
navigation.jar
NTime
doc-files
NTime.gif
GUI
doc-files
Class Diagram1.gif
GUI.gif
red.bmp
vssver.scc
yellow.bmp
NTimeSetup
mssccprj.scc
NTimeSetup.vdproj
NTimeSetup.vdproj.vspscc
vssver.scc
PerformanceTests
bin
Release
PerformanceTests.dll
PerformanceTests.ntime
ModelSupport
PerformanceTests
mssccprj.scc
PerformanceTests.csproj.user
PerformanceTests.csproj.vspscc
vssver.scc
ntime_src_20.zip
NTime_src_2.0
Framework
.VPUML
.history
.historyinfo_NTime.Framework.dll
NTime.Framework.dll.vpp.v1
NTime.Framework.dll.vpp
bin
Release
NTime.Framework.dll
ModelSupport
default.txvpck
NTime
Framework
Framework.txvpck
NTime.txvpck
mssccprj.scc
NTime.Framework
NTime.Framework.dll
NTime.Framework.dll.csproj.user
NTime.Framework.dll.csproj.vspscc
Properties
vssver.scc
NTimeConsole
App.ico
bin
Release
NTime.exe
NTime.Framework.dll
NTimeConsole.exe
ModelSupport
mssccprj.scc
NTime.csproj.user
NTime.csproj.vspscc
Properties
vssver.scc
NTimeGUI
.VPUML
.history
.historyinfo_NTimeGUI
NTimeGUI.vpp.v1
NTimeGUI.vpp
bin
Release
NTime.Framework.dll
NTimeGUI.exe
folder.bmp
folder2.bmp
gray.bmp
green.bmp
ModelSupport
default.txvpck
NTime
GUI
GUI.txvpck
NTime.txvpck
mssccprj.scc
NTime.ico
NTimeGUI.csproj.user
NTimeGUI.csproj.vspscc
out
doc
doc-files
default.gif
gendoc.gdc
model-tree
false.gif
model.tree
ST_Attribute.gif
ST_Class Diagram.gif
ST_Class.gif
ST_Operation.gif
ST_Package Diagram.gif
ST_Package.gif
ST_Project.gif
true.gif
navigation.jar
NTime
doc-files
NTime.gif
GUI
doc-files
Class Diagram1.gif
GUI.gif
Properties
red.bmp
vssver.scc
yellow.bmp
NTimeSetup
mssccprj.scc
NTimeSetup.vdproj
NTimeSetup.vdproj.vspscc
vssver.scc
PerformanceTests
bin
Release
NTime.Framework.dll
PerformanceTests.dll
PerformanceTests.ntime
ModelSupport
PerformanceTests
mssccprj.scc
PerformanceTests.csproj.user
PerformanceTests.csproj.vspscc
Properties
vssver.scc
#region Copyright (c) 2004, Adam Slosarski
/************************************************************************************
'
' Copyright  2004 Adam Slosarski
'
' This software is provided 'as-is', without any express or implied warranty. In no 
' event will the authors be held liable for any damages arising from the use of this 
' software.
' 
' Permission is granted to anyone to use this software for any purpose, including 
' commercial applications, and to alter it and redistribute it freely, subject to the 
' following restrictions:
'
' 1. The origin of this software must not be misrepresented; you must not claim that 
' you wrote the original software. If you use this software in a product, an 
' acknowledgment (see the following) in the product documentation is required.
'
' Portions Copyright  2004 Adam Slosarski
'
' 2. Altered source versions must be plainly marked as such, and must not be 
' misrepresented as being the original software.
'
' 3. This notice may not be removed or altered from any source distribution.
'
'***********************************************************************************/
#endregion
namespace NTimeAddin
{
	using System;
	using Microsoft.Office.Core;
	using Extensibility;
	using System.Runtime.InteropServices;
	using EnvDTE;

	#region Read me for Add-in installation and setup information.
	// When run, the Add-in wizard prepared the registry for the Add-in.
	// At a later time, if the Add-in becomes unavailable for reasons such as:
	//   1) You moved this project to a computer other than which is was originally created on.
	//   2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
	//   3) Registry corruption.
	// you will need to re-register the Add-in by building the MyAddin21Setup project 
	// by right clicking the project in the Solution Explorer, then choosing install.
	#endregion
	
	/// <summary>
	///   The object for implementing an Add-in.
	/// </summary>
	/// <seealso class='IDTExtensibility2' />
	[GuidAttribute("00A6F25D-A9CC-42A9-9A39-EFDC2EE2ED68"), ProgId("NTimeAddin.Connect")]
	public class Connect : Object, Extensibility.IDTExtensibility2, IDTCommandTarget
	{
		/// <summary>
		///		Implements the constructor for the Add-in object.
		///		Place your initialization code within this method.
		/// </summary>
		public Connect()
		{
		}

		/// <summary>
		///      Implements the OnConnection method of the IDTExtensibility2 interface.
		///      Receives notification that the Add-in is being loaded.
		/// </summary>
		/// <param term='application'>
		///      Root object of the host application.
		/// </param>
		/// <param term='connectMode'>
		///      Describes how the Add-in is being loaded.
		/// </param>
		/// <param term='addInInst'>
		///      Object representing this Add-in.
		/// </param>
		/// <seealso class='IDTExtensibility2' />
		public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
		{
			applicationObject = (_DTE)application;
			addInInstance = (AddIn)addInInst;
//			if(connectMode == Extensibility.ext_ConnectMode.ext_cm_UISetup)
			{
				object []contextGUIDS = new object[] { };
				Commands commands = applicationObject.Commands;
				_CommandBars commandBars = applicationObject.CommandBars;

				// When run, the Add-in wizard prepared the registry for the Add-in.
				// At a later time, the Add-in or its commands may become unavailable for reasons such as:
				//   1) You moved this project to a computer other than which is was originally created on.
				//   2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
				//   3) You add new commands or modify commands already defined.
				// You will need to re-register the Add-in by building the NTimeAddinSetup project,
				// right-clicking the project in the Solution Explorer, and then choosing install.
				// Alternatively, you could execute the ReCreateCommands.reg file the Add-in Wizard generated in
				// the project directory, or run 'devenv /setup' from a command prompt.
				try
				{
					Command command = commands.AddNamedCommand(addInInstance, "NTimeAddin", "NTimeAddin", "Executes the command for NTimeAddin", true, 59, ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled);
					CommandBar commandBar = (CommandBar)commandBars["Tools"];
					CommandBarControl commandBarControl = command.AddControl(commandBar, 1);
				}
				catch(System.Exception /*e*/)
				{
				}
			}
			
		}

		/// <summary>
		///     Implements the OnDisconnection method of the IDTExtensibility2 interface.
		///     Receives notification that the Add-in is being unloaded.
		/// </summary>
		/// <param term='disconnectMode'>
		///      Describes how the Add-in is being unloaded.
		/// </param>
		/// <param term='custom'>
		///      Array of parameters that are host application specific.
		/// </param>
		/// <seealso class='IDTExtensibility2' />
		public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode, ref System.Array custom)
		{
		}

		/// <summary>
		///      Implements the OnAddInsUpdate method of the IDTExtensibility2 interface.
		///      Receives notification that the collection of Add-ins has changed.
		/// </summary>
		/// <param term='custom'>
		///      Array of parameters that are host application specific.
		/// </param>
		/// <seealso class='IDTExtensibility2' />
		public void OnAddInsUpdate(ref System.Array custom)
		{
		}

		/// <summary>
		///      Implements the OnStartupComplete method of the IDTExtensibility2 interface.
		///      Receives notification that the host application has completed loading.
		/// </summary>
		/// <param term='custom'>
		///      Array of parameters that are host application specific.
		/// </param>
		/// <seealso class='IDTExtensibility2' />
		public void OnStartupComplete(ref System.Array custom)
		{
		}

		/// <summary>
		///      Implements the OnBeginShutdown method of the IDTExtensibility2 interface.
		///      Receives notification that the host application is being unloaded.
		/// </summary>
		/// <param term='custom'>
		///      Array of parameters that are host application specific.
		/// </param>
		/// <seealso class='IDTExtensibility2' />
		public void OnBeginShutdown(ref System.Array custom)
		{
		}
		
		/// <summary>
		///      Implements the QueryStatus method of the IDTCommandTarget interface.
		///      This is called when the command's availability is updated
		/// </summary>
		/// <param term='commandName'>
		///		The name of the command to determine state for.
		/// </param>
		/// <param term='neededText'>
		///		Text that is needed for the command.
		/// </param>
		/// <param term='status'>
		///		The state of the command in the user interface.
		/// </param>
		/// <param term='commandText'>
		///		Text requested by the neededText parameter.
		/// </param>
		/// <seealso class='Exec' />
		public void QueryStatus(string commandName, EnvDTE.vsCommandStatusTextWanted neededText, ref EnvDTE.vsCommandStatus status, ref object commandText)
		{
			if(neededText == EnvDTE.vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
			{
				if(commandName == "NTimeAddin.Connect.NTimeAddin")
				{
					status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported|vsCommandStatus.vsCommandStatusEnabled;
				}
			}
		}

		/// <summary>
		///      Implements the Exec method of the IDTCommandTarget interface.
		///      This is called when the command is invoked.
		/// </summary>
		/// <param term='commandName'>
		///		The name of the command to execute.
		/// </param>
		/// <param term='executeOption'>
		///		Describes how the command should be run.
		/// </param>
		/// <param term='varIn'>
		///		Parameters passed from the caller to the command handler.
		/// </param>
		/// <param term='varOut'>
		///		Parameters passed from the command handler to the caller.
		/// </param>
		/// <param term='handled'>
		///		Informs the caller if the command was handled or not.
		/// </param>
		/// <seealso class='Exec' />
		public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
		{
			handled = false;
			if(executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
			{
				if(commandName == "NTimeAddin.Connect.NTimeAddin")
				{
					handled = true;
					return;
				}
			}
		}
		private _DTE applicationObject;
		private AddIn addInInstance;
		
	}
}

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

AdamSlosarski
Web Developer
Poland Poland
Born in Poland, living there as employeed developer, in free time writing much .net stuff and designing applications.

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 31 Mar 2006
Article Copyright 2004 by AdamSlosarski
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid