Ejemplo n.º 1
0
 private void btnGneegrate_Click(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(ofdInputFile.FileName))
         {
             MessageBox.Show(this, "Please select a documentaion file");
             return;
         }
         if (_documentationModel == null)
         {
             MessageBox.Show(this, "Please select a valid documentaion file");
             return;
         }
         if (clbTypes.CheckedItems.Count == 0)
         {
             MessageBox.Show(this, "Please select at least one type to generate documentation for");
             return;
         }
         if (string.IsNullOrEmpty(fbdOutputPath.SelectedPath))
         {
             MessageBox.Show(this, "Please select the output folder");
             return;
         }
         if (string.IsNullOrEmpty(txtGitHubRepositoryRootURL.Text))
         {
             MessageBox.Show(this, "Please enter the GitHub repository root URL");
             return;
         }
         var markdownRenderer = new MarkdownRenderer(_documentationModel, fbdOutputPath.SelectedPath, txtGitHubRepositoryRootURL.Text);
         markdownRenderer.RenderSelectedTypes(clbTypes.CheckedItems.Cast <Model.Type>());
         MessageBox.Show(this, "Markdown files generated successfully!");
         System.Diagnostics.Process.Start(fbdOutputPath.SelectedPath);
     }
     catch (Exception exp)
     {
         MessageBox.Show(this, exp.Message);
     }
 }