Skip to content

fix System.ArgumentOutOfRangeException #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions GitVersionTree/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class MainForm : Form
{
private Dictionary<string, string> DecorateDictionary = new Dictionary<string, string>();
private List<List<string>> Nodes = new List<List<string>>();

private string DotFilename = Directory.GetParent(Application.ExecutablePath) + @"\" + Application.ProductName + ".dot";
private string PdfFilename = Directory.GetParent(Application.ExecutablePath) + @"\" + Application.ProductName + ".pdf";
private string LogFilename = Directory.GetParent(Application.ExecutablePath) + @"\" + Application.ProductName + ".log";
Expand Down Expand Up @@ -108,7 +108,7 @@ private void HomepageLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEv
{
Process.Start("https://github.com/crc8/GitVersionTree");
}

private void ExitButton_Click(object sender, EventArgs e)
{
Close();
Expand Down Expand Up @@ -323,7 +323,7 @@ private void Generate()
DotStringBuilder.Append(" subgraph Decorate" + DecorateCount + "\r\n");
DotStringBuilder.Append(" {\r\n");
DotStringBuilder.Append(" rank=\"same\";\r\n");
if (DecorateKeyValuePair.Value.Trim().Substring(0, 5) == "(tag:")
if (DecorateKeyValuePair.Value.Trim().StartsWith("(tag:"))
{
DotStringBuilder.Append(" \"" + DecorateKeyValuePair.Value.Trim() + "\" [shape=\"box\", style=\"filled\", fillcolor=\"#ffffdd\"];\r\n");
}
Expand All @@ -344,18 +344,18 @@ private void Generate()
DotProcess.StartInfo.CreateNoWindow = true;
DotProcess.StartInfo.RedirectStandardOutput = true;
DotProcess.StartInfo.FileName = GraphvizDotPathTextBox.Text;
DotProcess.StartInfo.Arguments = "\"" + @DotFilename + "\" -Tpdf -Gsize=10,10 -o\"" + @PdfFilename + "\"";
DotProcess.StartInfo.Arguments = "\"" + @DotFilename + "\" -Tpdf -o\"" + @PdfFilename + "\"";
DotProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
DotProcess.Start();
DotProcess.WaitForExit();

DotProcess.StartInfo.Arguments = "\"" + @DotFilename + "\" -Tps -o\"" + @PdfFilename.Replace(".pdf", ".ps") + "\"";
DotProcess.Start();
DotProcess.WaitForExit();
if (DotProcess.ExitCode == 0)
{
if (File.Exists(@PdfFilename))
{
//DotProcess.StartInfo.Arguments = "\"" + @DotFilename + "\" -Tps -o\"" + @PdfFilename.Replace(".pdf", ".ps") + "\"";
//DotProcess.Start();
//DotProcess.WaitForExit();
//if (DotProcess.ExitCode == 0)
//{
//if (File.Exists(@PdfFilename))
//{
#if (!DEBUG)
/*
Process ViewPdfProcess = new Process();
Expand All @@ -365,12 +365,12 @@ private void Generate()
//Close();
*/
#endif
}
}
else
{
Status("Version tree generation failed ...");
}
//}
//}
//else
//{
//Status("Version tree generation failed ...");
//}

Status("Done! ...");
}
Expand Down