<AddIn name        = "MbUnit-Addin"
       author      = "Daniel Grunwald"
       copyright   = "prj:///doc/copyright.txt"
       description = "Runs MbUnit and NUnit tests inside #Develop">
	
	<Manifest>
		<Identity name = "ICSharpCode.MbUnitPad"/>
	</Manifest>
	
	<Runtime>
		<!-- MbUnit is not in the path, so we need to load it manually -->
		<Import assembly = "../../../../bin/Tools/MbUnit/MbUnit.GUI.exe"/>
		<Import assembly = "MbUnitPad.dll">
			<ConditionEvaluator name = "MbUnitTestable" class = "ICSharpCode.MbUnitPad.MbUnitTestableCondition"/>
			<ConditionEvaluator name = "MbUnitRunningTests" class = "ICSharpCode.MbUnitPad.MbUnitRunningTestsCondition"/>
		</Import>
	</Runtime>
	
	<Path name = "/SharpDevelop/Workbench/Pads">
		<Pad id       = "MbUnitPad"
		     category = "Tools"
		     title    = "${res:ICSharpCode.NUnitPad.NUnitPadContent.PadName}"
		     icon     = "PadIcons.MbUnitTest"
		     shortcut = "Control|Alt|T"
		     class    = "ICSharpCode.MbUnitPad.MbUnitPadContent"/>
	</Path>
	
	<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ClassMemberContextMenu">
		<Include id = "MbUnitTests" insertbefore = "MenuBuilder" item="/SharpDevelop/Pads/ClassBrowser/MemberContextMenu/MbUnitTestMenu"/>
	</Path>
	
	<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ClassBookmarkContextMenu">
		<Include id = "MbUnitTests" insertbefore = "MenuBuilder" item="/SharpDevelop/Pads/ClassBrowser/ClassContextMenu/MbUnitTestMenu"/>
	</Path>
	
	<Path name = "/SharpDevelop/Pads/ClassBrowser/MemberContextMenu">
		<Condition name = "MbUnitTestable">
			<MenuItem id="MbUnitTestMenu" type="Menu" label="Unit Testing" icon="PadIcons.MbUnitTest" insertbefore="MenuBuilder">
				<MenuItem id    = "RunInPad"
				          label = "Run in unit test pad"
				          icon  = "PadIcons.MbUnitTest"
				          class = "ICSharpCode.MbUnitPad.RunTestInPadCommand"/>
				<MenuItem id    = "RunWithDebugger"
				          label = "Run in console with debugger"
				          icon  = "Icons.16x16.RunProgramIcon"
				          class = "ICSharpCode.MbUnitPad.RunTestWithDebuggerCommand"/>
			</MenuItem>
		</Condition>
	</Path>
	
	<Path name = "/SharpDevelop/Pads/ClassBrowser/ClassContextMenu">
		<Condition name = "MbUnitTestable">
			<MenuItem id="MbUnitTestMenu" type="Menu" label="Unit Testing" icon="PadIcons.MbUnitTest" insertbefore="MenuBuilder">
				<MenuItem id    = "RunInPad"
				          label = "Run in unit test pad"
				          icon  = "PadIcons.MbUnitTest"
				          class = "ICSharpCode.MbUnitPad.RunTestInPadCommand"/>
				<MenuItem id    = "RunWithDebugger"
				          label = "Run in console with debugger"
				          icon  = "Icons.16x16.RunProgramIcon"
				          class = "ICSharpCode.MbUnitPad.RunTestWithDebuggerCommand"/>
			</MenuItem>
		</Condition>
	</Path>
	
	<Path name = "/SharpDevelop/Pads/MbUnitPad/Toolbar">
		<Condition name = "SolutionOpen" action="Disable">
			<ToolbarItem id      = "Reload"
			             icon    = "Icons.16x16.BrowserRefresh"
			             tooltip = "${res:NUnitPad.NUnitPadContent.RefreshItem}"
			             class   = "ICSharpCode.MbUnitPad.ReloadCommand"/>
			<ToolbarItem id      = "Unload"
			             icon    = "Icons.16x16.BrowserCancel"
			             tooltip = "${res:NUnitPad.NUnitPadContent.CancelItem}"
			             class   = "ICSharpCode.MbUnitPad.UnloadCommand"/>
			<ToolbarItem id      = "Separator1" type = "Separator"/>
			<ToolbarItem id      = "AddMbUnitReference"
			             icon    = "Icons.16x16.Reference"
			             tooltip = "${res:MbUnitPad.ReferenceItem}"
			             class   = "ICSharpCode.MbUnitPad.AddMbUnitReferenceCommand"/>
			<ToolbarItem id      = "AddNUnitReference"
			             icon    = "PadIcons.NUnitTest"
			             tooltip = "${res:NUnitPad.NUnitPadContent.ReferenceItem}"
			             class   = "ICSharpCode.MbUnitPad.AddNUnitReferenceCommand"/>
			<ToolbarItem id      = "Separator2" type = "Separator"/>
		</Condition>
		<ComplexCondition action="Disable">
			<And>
				<Condition name="SolutionOpen"/>
				<Not>
					<Condition name="MbUnitRunningTests"/>
				</Not>
			</And>
					<ToolbarItem id      = "Run"
			                     icon    = "Icons.16x16.RunProgramIcon"
			                     tooltip = "${res:NUnitPad.NUnitPadContent.RunItem}"
			                     class   = "ICSharpCode.MbUnitPad.RunTestsCommand"/>
		</ComplexCondition>
		<ComplexCondition action="Disable">
			<And>
				<Condition name="SolutionOpen"/>
				<Condition name="MbUnitRunningTests"/>
			</And>
					<ToolbarItem id      = "Stop"
			                     icon    = "Icons.16x16.Debug.StopProcess"
			                     tooltip = "Stop tests"
			                     class   = "ICSharpCode.MbUnitPad.StopTestsCommand"/>
		</ComplexCondition>
	</Path>
	
	<Path name = "/SharpDevelop/Pads/MbUnitPad/ContextMenu">
		<ComplexCondition action="Disable">
			<And>
				<Condition name="Ownerstate" ownerstate="TestItemSelected"/>
				<Not>
					<Condition name="MbUnitRunningTests"/>
				</Not>
			</And>
			<MenuItem id    = "Run"
			          icon  = "Icons.16x16.RunProgramIcon"
			          label = "${res:NUnitPad.NUnitPadContent.RunTestsContextMenuLabel}"
			          class = "ICSharpCode.MbUnitPad.RunTestsCommand"/>
		</ComplexCondition>
		<ComplexCondition action="Disable">
			<And>
				<Condition name="Ownerstate" ownerstate="TestItemSelected"/>
				<Condition name="MbUnitRunningTests"/>
			</And>
			<MenuItem id    = "Stop"
			          icon  = "Icons.16x16.Debug.StopProcess"
			          label = "Stop tests"
			          class = "ICSharpCode.MbUnitPad.StopTestsCommand"/>
		</ComplexCondition>
		<Condition name="Ownerstate" ownerstate="SourceCodeItemSelected" action="Disable">

			<MenuItem id = "GotoDefinition"
			          label = "${res:NUnitPad.NUnitPadContent.GotoDefinitionContextMenuLabel}"
			          class = "ICSharpCode.MbUnitPad.GotoDefinitionCommand"/>
		</Condition>
		<MenuItem id="Tree"
		          label="Tree"
		          type="Menu">
			<MenuItem id = "ExpandAll"
			          label = "Expand all"
			          class = "ICSharpCode.MbUnitPad.ExpandAllCommand"/>
			<MenuItem id = "CollapseAll"
			          label = "Collapse all"
			          class = "ICSharpCode.MbUnitPad.CollapseAllCommand"/>
			<MenuItem id="Separator1" type = "Separator"/>
			<MenuItem id = "ExpandCurrent"
			          label = "Expand current"
			          class = "ICSharpCode.MbUnitPad.ExpandCurrentCommand"/>
			<MenuItem id = "CollapseCurrent"
			          label = "Collapse current"
			          class = "ICSharpCode.MbUnitPad.CollapseCurrentCommand"/>
			<MenuItem id="Separator2" type = "Separator"/>
			<MenuItem id = "ExpandAllFailures"
			          label = "Expand all failures"
			          class = "ICSharpCode.MbUnitPad.ExpandAllFailuresCommand"/>
			<MenuItem id = "ExpandCurrentFailures"
			          label = "Expand current failures"
			          class = "ICSharpCode.MbUnitPad.ExpandCurrentFailuresCommand"/>
			<MenuItem id="Separator3" type = "Separator"/>
			<MenuItem id = "ExpandAllIgnored"
			          label = "Expand all ignored"
			          class = "ICSharpCode.MbUnitPad.ExpandAllIgnoredCommand"/>
			<MenuItem id = "ExpandCurrentIgnored"
			          label = "Expand current ignored"
			          class = "ICSharpCode.MbUnitPad.ExpandCurrentIgnoredCommand"/>
			<MenuItem id="Separator4" type = "Separator"/>
			<MenuItem id = "ClearResults"
			          label = "Clear results"
			          class = "ICSharpCode.MbUnitPad.ClearResultsCommand"/>
		</MenuItem>
	</Path>
</AddIn>
