Exemplo n.º 1
0
        public static void FormatFile(string fileName)
        {
            if (string.IsNullOrEmpty(fileName) || !File.Exists(fileName))
                return;

            string extension = Path.GetExtension(fileName);
            if (extension == ".xml")
            {
                FormatFile(fileName);
            }
            else
            {
                ProcessBackground pbg = new SyncProcessBackground(Path.Combine(Application.StartupPath, @"Addins\AStyle.exe"));
                string args = string.Format("--style=allman -N -Y {0}", fileName);
                pbg.ExecuteCommand(args);
            }
        }