Compare new file with old copy in cpy-lib

This commit is contained in:
2015-09-03 13:51:22 +02:00
parent b70c342f4c
commit 9f1d527f32
3 changed files with 23 additions and 0 deletions

View File

@ -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();

View File

@ -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;
}
}

View File

@ -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);
}
}
}