Skip to content

Instantly share code, notes, and snippets.

@hach-que
Created March 15, 2024 06:21
Show Gist options
  • Save hach-que/e0bda7a24a3470e5798b2d8ba382bebb to your computer and use it in GitHub Desktop.
Save hach-que/e0bda7a24a3470e5798b2d8ba382bebb to your computer and use it in GitHub Desktop.
"Format all open files" for Visual Commander
using EnvDTE;
using EnvDTE80;
public class C : VisualCommanderExt.ICommand
{
public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package)
{
foreach (EnvDTE.Document document in DTE.Documents)
{
document.Activate();
DTE.ExecuteCommand("Edit.FormatDocument");
document.Save();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment