From 328b12a97401bd42f4b72757f583b866f68eecb3 Mon Sep 17 00:00:00 2001 From: dds_feng Date: Fri, 26 Dec 2014 12:29:00 +0800 Subject: [PATCH 1/2] fix System.ArgumentOutOfRangeException (when DecorateKeyValuePair.Value.Trim().Length < 5) --- GitVersionTree/Forms/MainForm.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GitVersionTree/Forms/MainForm.cs b/GitVersionTree/Forms/MainForm.cs index c1a55af..2366c1e 100644 --- a/GitVersionTree/Forms/MainForm.cs +++ b/GitVersionTree/Forms/MainForm.cs @@ -16,7 +16,7 @@ public partial class MainForm : Form { private Dictionary DecorateDictionary = new Dictionary(); private List> Nodes = new List>(); - + 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"; @@ -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(); @@ -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"); } From f62852779a197ff3c4c68aad2177a6243d9b1b77 Mon Sep 17 00:00:00 2001 From: dds_feng Date: Sun, 11 Jan 2015 00:32:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=94=9F=E6=88=90PDF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E5=A4=A7=E5=B0=8F=E9=99=90=E5=88=B6?= =?UTF-8?q?,=E4=B8=8D=E5=86=8D=E7=94=9F=E6=88=90ps=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GitVersionTree/Forms/MainForm.cs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/GitVersionTree/Forms/MainForm.cs b/GitVersionTree/Forms/MainForm.cs index 2366c1e..de202a1 100644 --- a/GitVersionTree/Forms/MainForm.cs +++ b/GitVersionTree/Forms/MainForm.cs @@ -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(); @@ -365,12 +365,12 @@ private void Generate() //Close(); */ #endif - } - } - else - { - Status("Version tree generation failed ..."); - } + //} + //} + //else + //{ + //Status("Version tree generation failed ..."); + //} Status("Done! ..."); }