diff --git a/CobXmlSupport/ShowCode.Designer.cs b/CobXmlSupport/ShowCode.Designer.cs index b21824f..603b3ac 100644 --- a/CobXmlSupport/ShowCode.Designer.cs +++ b/CobXmlSupport/ShowCode.Designer.cs @@ -36,15 +36,16 @@ this.btnSynchOut = new System.Windows.Forms.Button(); this.btnSaveAktualText = new System.Windows.Forms.Button(); this.btnCompare = new System.Windows.Forms.Button(); + this.btnMoveToLib = new System.Windows.Forms.Button(); this.SuspendLayout(); // // btnClose // this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnClose.Location = new System.Drawing.Point(604, 642); - this.btnClose.Margin = new System.Windows.Forms.Padding(2); + this.btnClose.Location = new System.Drawing.Point(805, 790); + this.btnClose.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnClose.Name = "btnClose"; - this.btnClose.Size = new System.Drawing.Size(56, 23); + this.btnClose.Size = new System.Drawing.Size(75, 28); this.btnClose.TabIndex = 0; this.btnClose.Text = "Close"; this.btnClose.UseVisualStyleBackColor = true; @@ -56,12 +57,12 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtCode.Font = new System.Drawing.Font("Courier New", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtCode.Location = new System.Drawing.Point(11, 54); - this.txtCode.Margin = new System.Windows.Forms.Padding(2); + this.txtCode.Location = new System.Drawing.Point(15, 66); + this.txtCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.txtCode.Multiline = true; this.txtCode.Name = "txtCode"; this.txtCode.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtCode.Size = new System.Drawing.Size(650, 578); + this.txtCode.Size = new System.Drawing.Size(865, 710); this.txtCode.TabIndex = 1; this.txtCode.TextChanged += new System.EventHandler(this.txtCode_TextChanged); this.txtCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtCode_KeyDown); @@ -70,8 +71,7 @@ // this.lblCodeType.AutoSize = true; this.lblCodeType.Font = new System.Drawing.Font("Microsoft YaHei UI", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblCodeType.Location = new System.Drawing.Point(9, 28); - this.lblCodeType.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblCodeType.Location = new System.Drawing.Point(12, 34); this.lblCodeType.Name = "lblCodeType"; this.lblCodeType.Size = new System.Drawing.Size(75, 16); this.lblCodeType.TabIndex = 2; @@ -80,9 +80,10 @@ // btnSynch // this.btnSynch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSynch.Location = new System.Drawing.Point(494, 642); + this.btnSynch.Location = new System.Drawing.Point(659, 790); + this.btnSynch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnSynch.Name = "btnSynch"; - this.btnSynch.Size = new System.Drawing.Size(105, 23); + this.btnSynch.Size = new System.Drawing.Size(140, 28); this.btnSynch.TabIndex = 3; this.btnSynch.Text = "Synch Moves To"; this.btnSynch.UseVisualStyleBackColor = true; @@ -92,9 +93,10 @@ // btnSynchOut // this.btnSynchOut.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnSynchOut.Location = new System.Drawing.Point(378, 642); + this.btnSynchOut.Location = new System.Drawing.Point(504, 790); + this.btnSynchOut.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnSynchOut.Name = "btnSynchOut"; - this.btnSynchOut.Size = new System.Drawing.Size(110, 23); + this.btnSynchOut.Size = new System.Drawing.Size(147, 28); this.btnSynchOut.TabIndex = 4; this.btnSynchOut.Text = "Synch Moves From"; this.btnSynchOut.UseVisualStyleBackColor = true; @@ -104,9 +106,10 @@ // btnSaveAktualText // this.btnSaveAktualText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnSaveAktualText.Location = new System.Drawing.Point(12, 642); + this.btnSaveAktualText.Location = new System.Drawing.Point(16, 790); + this.btnSaveAktualText.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnSaveAktualText.Name = "btnSaveAktualText"; - this.btnSaveAktualText.Size = new System.Drawing.Size(83, 23); + this.btnSaveAktualText.Size = new System.Drawing.Size(111, 28); this.btnSaveAktualText.TabIndex = 5; this.btnSaveAktualText.Text = "Spara Copy"; this.btnSaveAktualText.UseVisualStyleBackColor = true; @@ -114,19 +117,32 @@ // // btnCompare // - this.btnCompare.Location = new System.Drawing.Point(101, 642); + this.btnCompare.Location = new System.Drawing.Point(135, 790); + this.btnCompare.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.btnCompare.Name = "btnCompare"; - this.btnCompare.Size = new System.Drawing.Size(98, 23); + this.btnCompare.Size = new System.Drawing.Size(131, 28); this.btnCompare.TabIndex = 6; this.btnCompare.Text = "Compare Existing"; this.btnCompare.UseVisualStyleBackColor = true; this.btnCompare.Click += new System.EventHandler(this.btnCompare_Click); // + // btnMoveToLib + // + this.btnMoveToLib.Enabled = false; + this.btnMoveToLib.Location = new System.Drawing.Point(273, 790); + this.btnMoveToLib.Name = "btnMoveToLib"; + this.btnMoveToLib.Size = new System.Drawing.Size(131, 28); + this.btnMoveToLib.TabIndex = 7; + this.btnMoveToLib.Text = "Flytta Till cpylib"; + this.btnMoveToLib.UseVisualStyleBackColor = true; + this.btnMoveToLib.Click += new System.EventHandler(this.btnMoveToLib_Click); + // // ShowCode // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(670, 674); + this.ClientSize = new System.Drawing.Size(893, 830); + this.Controls.Add(this.btnMoveToLib); this.Controls.Add(this.btnCompare); this.Controls.Add(this.btnSaveAktualText); this.Controls.Add(this.btnSynchOut); @@ -135,7 +151,7 @@ this.Controls.Add(this.txtCode); this.Controls.Add(this.btnClose); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(2); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "ShowCode"; this.Text = "ShowCode"; this.Load += new System.EventHandler(this.ShowCode_Load); @@ -153,5 +169,6 @@ private System.Windows.Forms.Button btnSynchOut; private System.Windows.Forms.Button btnSaveAktualText; private System.Windows.Forms.Button btnCompare; + private System.Windows.Forms.Button btnMoveToLib; } } \ No newline at end of file diff --git a/CobXmlSupport/ShowCode.cs b/CobXmlSupport/ShowCode.cs index cfb0480..a71336e 100644 --- a/CobXmlSupport/ShowCode.cs +++ b/CobXmlSupport/ShowCode.cs @@ -25,6 +25,7 @@ namespace CobXmlSupport bool bSynch; string finalFileSafe; string wholeFilePath; + string existing = ""; public savedFile SavedFile { get; set; } @@ -33,6 +34,7 @@ namespace CobXmlSupport InitializeComponent(); oldTxt = ""; bSynch = false; + btnMoveToLib.Enabled = false; } public bool BSynch @@ -61,7 +63,7 @@ namespace CobXmlSupport set { wholeFilePath = value; - lblCodeType.Text = wholeFilePath.Substring(wholeFilePath.LastIndexOf("\\")+1); ; + lblCodeType.Text = wholeFilePath.Substring(wholeFilePath.LastIndexOf("\\") + 1); ; } } @@ -100,9 +102,9 @@ namespace CobXmlSupport private void btnSynch_Click(object sender, EventArgs e) { - codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text,parentWindow.FldPref); + codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text, parentWindow.FldPref); string fieldCompl = ""; - this.CodeShower.Text = " InPath = " + Cc.PathId + "\r\n InFile = " + Cc.FileId + "\r\n codeFile = " + Cc.CcFileInId + "\r\n codePath = " + Cc.PathId+Cc.CcFileInId + "\r\n -------------- \r\n" + this.CodeShower.Text; + this.CodeShower.Text = " InPath = " + Cc.PathId + "\r\n InFile = " + Cc.FileId + "\r\n codeFile = " + Cc.CcFileInId + "\r\n codePath = " + Cc.PathId + Cc.CcFileInId + "\r\n -------------- \r\n" + this.CodeShower.Text; Cc.TryFill_In_Dic(); foreach (CobRow cr in parentWindow.RowList) @@ -117,7 +119,7 @@ namespace CobXmlSupport } } if (cr.MoveCode == null) { cr.MoveCode = " "; } - Cc.WorkDicIn[cr.FieldName]=cr.MoveCode; + Cc.WorkDicIn[cr.FieldName] = cr.MoveCode; } } @@ -307,7 +309,7 @@ namespace CobXmlSupport private void btnSynchOut_Click(object sender, EventArgs e) { - codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text,parentWindow.FldPref); + codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text, parentWindow.FldPref); string fieldCompl = ""; this.CodeShower.Text = " InPath = " + Cc.PathId + "\r\n InFile = " + Cc.FileId + "\r\n codeFile = " + Cc.CcFileOutId + "\r\n codePath = " + Cc.PathId + Cc.CcFileOutId + "\r\n -------------- \r\n" + this.CodeShower.Text; Cc.TryFill_Out_Dic(); @@ -363,16 +365,34 @@ namespace CobXmlSupport private void btnCompare_Click(object sender, EventArgs e) { + existing = ""; try { - string existing = finalFileSafe.Substring(finalFileSafe.LastIndexOf("\\")+1); + existing = finalFileSafe.Substring(finalFileSafe.LastIndexOf("\\") + 1); Process.Start("C:\\Program Files (x86)\\WinMerge\\WinMergeU.exe", finalFileSafe + " Q:\\kII20\\cpy\\" + existing); } catch (Exception ex) { MessageBox.Show("Problem vid starta WinMerge :" + ex.Message); } + btnMoveToLib.Enabled = true; + } + + private void btnMoveToLib_Click(object sender, EventArgs e) + { + try + { + if (DialogResult.OK == MessageBox.Show("Ok att kopiera :" + finalFileSafe + "\r\ntill Q:\\kII20\\cpy\\" + existing, "Kopiering", MessageBoxButtons.OKCancel)) + { + File.Copy(finalFileSafe, "Q:\\kII20\\cpy\\" + existing); + btnMoveToLib.Enabled = false; + } + } + catch (Exception ex) + { + MessageBox.Show("Problem vid filkopiering :" + ex.Message); + } } }