Created
March 15, 2024 06:21
-
-
Save hach-que/e0bda7a24a3470e5798b2d8ba382bebb to your computer and use it in GitHub Desktop.
"Format all open files" for Visual Commander
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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