Extensible Markup Extension
Features!
- Create Solutionwide Commands shown in the the Toolbar
- Create Solutionwide Commands shown in the contextmenu of Projects inside the Solution Explorer
Commands can:
- Execute a single application
- Activate or Execute a single application
- Execute a batch of commandlines
Installation
First you have to install the Extension for Visual Studio 2022.
After installation restart Visual Studio and open any Solution
Find the Settingsicon on the toolbar. If there is none please add the "Extensible Markup Extension" toolbar using the context menu.
After clicking Visual Studio will open Commands.xml.
XSD Support
If you want full codecompletion in the config file you have to enable automatic schema download
Goto Options-> Text Editor ->XML ->Miscellaneous-> Automatically download DTDs and schemas
When you finished editing, the saved Commands.xml will be automatically deserialized and you will immediately see your changes in Visual Studio.
XML Structure
The XML-Root just includes the reference to the XSD-Schema. The inner Commands node contains up to 20 XmlCommands (see Commands.xml)
<?xml version="1.0" encoding="utf-16"?>
<XmlCommands xsi:schemaLocation="https://extensiblemarkupextension.heydorn.dev https://extensiblemarkupextension.heydorn.dev/ExtensibleMarkupExtensionSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://extensiblemarkupextension.heydorn.dev">
...
</XmlCommands>
XmlCommand
<XmlCommand icon="SymlinkFile" buttonTitle="Build Backend" attachToToolbar="true">
...
</XmlCommand>
Attributes
Attribute |
Description |
icon |
the identifier of the Icon |
buttonTitle |
the display title of the button |
attachToProjectContextMenu |
show the button in the contextmenu of a project |
attachToToolbar |
show the button in the toolbar |
projectFilename |
when attachToProjectContextMenu is true this string has to be part of the path of the .csproj file |
Icons
Identifier |
Icon |
PowershellFile |
|
JSScript |
|
ExecuteDDL |
|
Git |
|
Play |
|
New |
|
LogError |
|
Log |
|
Output |
|
Open |
|
StartWebSite |
|
StartupApplication |
|
SymlinkFile |
|
Sync |
|
ASPWebSite |
|
PackageDeployment |
|
AzureWebSites |
|
CSDynamicWebSite |
|
Home |
|
IntellisenseLightBulb |
|
VisualStudio |
|
Windows |
|
WindowsAzure |
|
Console |
|
Refresh |
|
Settings |
|
XmlIncludeCommand
<XmlInclueCommand path="$(SolutionDir)Other.xml" />
Attributes
Attribute |
Description |
path |
the path of the configurationfile to include |
MessageBoxCommand
<MessageBoxCommand icon="Question" caption="Question" text="Are you sure?" buttons="OKCancel">
<OnButtonClick button="OK">
<MessageBoxCommand icon="Exclamation" caption="Question" text="you clicked ok" />
</OnButtonClick>
<OnButtonClick button="Cancel">
<MessageBoxCommand icon="Exclamation" caption="Question" text="you clicked Cancel" />
</OnButtonClick>
</MessageBoxCommand>
Attributes
Attribute |
Description |
text |
the text of the MessageBox |
caption |
the caption of the MessageBox |
icon |
None, Error, Hand, Stop, Question, Exclamation, Warning, Asterisk, Information |
button |
OK, OKCancel, AbortRetryIgnore, YesNoCancel, YesNo, RetryCancel |
RunApplicationCommand
A RunApplicationCommand is executing a single executable without displaying a console window
<XmlCommand icon="Settings" buttonTitle="Setup new Commands" attachToProjectContextMenu="false" attachToToolbar="true" projectFilename="csproj" >
<RunApplicationCommand workingDirectory="$(VisualStudioPath)" path="$(VisualStudioPath)" arguments="$(SolutionDir)Commands.xml /Edit" />
</XmlCommand>
Attributes
Attribute |
Description |
path |
the path of the executable |
arguments |
the arguments to pass to the executable |
workingDirectory |
the workingDirectory of the process |
OpenApplicationCommand
<XmlCommand icon="Git" buttonTitle="Click here to create your first command" attachToToolbar="true">
<OpenApplicationCommand path="C:\Program Files (x86)\GitExtensions\GitExtensions.exe" arguments="browse $(SolutionDir)" windowTitle="ExtensibleMarkupExtension"/>
</XmlCommand>
Attributes
Attribute |
Description |
path |
the path of the executable |
arguments |
the arguments to pass to the executable |
workingDirectory |
the workingDirectory of the process |
windowTitle |
if the executable is already running, its mainwindow will be activated, when the windowTitle contains this string. |
BatchCommand
<XmlCommand icon="SymlinkFile" buttonTitle="Build Backend" attachToToolbar="true">
<BatchCommand workingDirectory="$(SolutionDir)">
@echo off
powershell -ExecutionPolicy ByPass $(SolutionDir)Foundation\Awesome.Core\link.ps1
pause
</BatchCommand>
</XmlCommand>
Attributes
Attribute |
Description |
workingDirectory |
the workingDirectory of the process |
keepWindowOpened |
if true, the console window will stay open, when the command is executed. |
Variables
You can use the these variables:
- $(SolutionDir)
- $(SolutionPath)
- $(SolutionName)
- $(UserOptionsPath)
- $(VisualStudioPath)
- $(ProjectDir)
- $(ProjectPath)
License
MIT