diff --git a/CobXmlSupport/SaveRegCopyFile.cs b/CobXmlSupport/SaveRegCopyFile.cs index 511ff4b..a13ddd2 100644 --- a/CobXmlSupport/SaveRegCopyFile.cs +++ b/CobXmlSupport/SaveRegCopyFile.cs @@ -14,6 +14,7 @@ namespace CobXmlSupport { public savedFile SavedFile { get; set; } public string FileData { get; set; } + public string finalFileName { get; set; } public SaveRegCopyFile() { @@ -42,6 +43,7 @@ namespace CobXmlSupport { try { + this.finalFileName = saveFileDialog.FileName; File.WriteAllText(saveFileDialog.FileName, FileData); SavedFile.saveDate = DateTime.Now; savedFile tmpSF = new savedFile(); diff --git a/CobXmlSupport/ShowCode.Designer.cs b/CobXmlSupport/ShowCode.Designer.cs index ab5d955..b21824f 100644 --- a/CobXmlSupport/ShowCode.Designer.cs +++ b/CobXmlSupport/ShowCode.Designer.cs @@ -35,6 +35,7 @@ this.btnSynch = new System.Windows.Forms.Button(); this.btnSynchOut = new System.Windows.Forms.Button(); this.btnSaveAktualText = new System.Windows.Forms.Button(); + this.btnCompare = new System.Windows.Forms.Button(); this.SuspendLayout(); // // btnClose @@ -111,11 +112,22 @@ this.btnSaveAktualText.UseVisualStyleBackColor = true; this.btnSaveAktualText.Click += new System.EventHandler(this.btnSaveAktualText_Click); // + // btnCompare + // + this.btnCompare.Location = new System.Drawing.Point(101, 642); + this.btnCompare.Name = "btnCompare"; + this.btnCompare.Size = new System.Drawing.Size(98, 23); + this.btnCompare.TabIndex = 6; + this.btnCompare.Text = "Compare Existing"; + this.btnCompare.UseVisualStyleBackColor = true; + this.btnCompare.Click += new System.EventHandler(this.btnCompare_Click); + // // ShowCode // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(670, 674); + this.Controls.Add(this.btnCompare); this.Controls.Add(this.btnSaveAktualText); this.Controls.Add(this.btnSynchOut); this.Controls.Add(this.btnSynch); @@ -140,5 +152,6 @@ private System.Windows.Forms.Button btnSynch; private System.Windows.Forms.Button btnSynchOut; private System.Windows.Forms.Button btnSaveAktualText; + private System.Windows.Forms.Button btnCompare; } } \ No newline at end of file diff --git a/CobXmlSupport/ShowCode.cs b/CobXmlSupport/ShowCode.cs index cf7ccbc..5f5c549 100644 --- a/CobXmlSupport/ShowCode.cs +++ b/CobXmlSupport/ShowCode.cs @@ -23,6 +23,7 @@ namespace CobXmlSupport string oldTxt; bool bSynch; + string finalFileSafe; public savedFile SavedFile { get; set; } @@ -336,6 +337,7 @@ namespace CobXmlSupport saveWin.SavedFile = this.SavedFile; saveWin.FileData = this.txtCode.Text; saveWin.ShowDialog(); + finalFileSafe = saveWin.finalFileName; } private void ShowCode_Load(object sender, EventArgs e) @@ -347,5 +349,11 @@ namespace CobXmlSupport else btnSaveAktualText.Enabled = true; } + private void btnCompare_Click(object sender, EventArgs e) + { + string existing = finalFileSafe.Substring(finalFileSafe.LastIndexOf("\\")); + Process.Start("C:\\Program Files (x86)\\WinMerge\\WinMergeU.exe",finalFileSafe +" Q:\\kII20\\cpy\\"+existing); + } + } }