Example #1
0
 private void buttonExportDot_Click(object sender, EventArgs e)
 {
     if (saveDotFileDialog.ShowDialog() == DialogResult.OK)
     {
         using (Stream fileStream = saveDotFileDialog.OpenFile())
         {
             using (StreamWriter streamWriter = new StreamWriter(fileStream, Encoding.UTF8))
             {
                 streamWriter.Write(_dependencies.ToDotFormat());
                 MessageBox.Show(this, "Dependencies have been successfully exported.", "Export completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
 }
Example #2
0
 private static void ProcessDependencyExportCommand(string args)
 {
     if (args == "")
     {
         Console.WriteLine("Error: No file specified, export must be saved to a file");
         return;
     }
     try
     {
         using (StreamWriter file = new StreamWriter(args))
         {
             file.Write(_dependencies.ToDotFormat());
             Console.WriteLine("Export saved");
         }
     }
     catch (Exception exc)
     {
         Debug.WriteLine(exc);
         Console.WriteLine($"Error: Export cannot be saved - {exc.Message}");
     }
     Console.WriteLine();
 }