ACAT.Extensions.Default.FunctionalAgents.NewFile.NewFileAgent.createAndLaunchNotepad C# (CSharp) Méthode

createAndLaunchNotepad() private méthode

Creates a text file and launches notepad
private createAndLaunchNotepad ( String fileName ) : bool
fileName String name of the text file
Résultat bool
        private bool createAndLaunchNotepad(String fileName)
        {
            try
            {
                StreamWriter writer = File.CreateText(fileName);
                writer.Close();

                var startInfo = new ProcessStartInfo { FileName = "notepad.exe", Arguments = fileName };
                var process = Process.Start(startInfo);
                waitForProcessAndActivate(process);
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
                return false;
            }

            return true;
        }