diff --git a/CobXmlSupport/CobRow.cs b/CobXmlSupport/CobRow.cs index de6c147..f4107a5 100644 --- a/CobXmlSupport/CobRow.cs +++ b/CobXmlSupport/CobRow.cs @@ -44,9 +44,13 @@ namespace CobXmlSupport public string SampleStr { get; set; } public string MoveCode { get; set; } - //Holding code-parts used when generating moves, to and from structure + //Holding code-parts used when generating moves, to structure //Could be a Variable, simple or qualified, could be retreival code. //Will replace "MOVE " when generating move sequences + public string MoveFromCode { get; set; } + //Holding code-parts used when generating moves, from structure + //Could be a Variable, simple or qualified, could be retreival code. + //Will replace "TO " when generating move sequences public string FieldName { diff --git a/CobXmlSupport/GenCobCode.Designer.cs b/CobXmlSupport/GenCobCode.Designer.cs index 58f818c..8c9b3d3 100644 --- a/CobXmlSupport/GenCobCode.Designer.cs +++ b/CobXmlSupport/GenCobCode.Designer.cs @@ -447,7 +447,7 @@ // btnCrossref // this.btnCrossref.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnCrossref.Location = new System.Drawing.Point(21, 662); + this.btnCrossref.Location = new System.Drawing.Point(191, 616); this.btnCrossref.Name = "btnCrossref"; this.btnCrossref.Size = new System.Drawing.Size(81, 23); this.btnCrossref.TabIndex = 35; @@ -459,7 +459,7 @@ // this.chkBackupVars.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.chkBackupVars.AutoSize = true; - this.chkBackupVars.Location = new System.Drawing.Point(109, 664); + this.chkBackupVars.Location = new System.Drawing.Point(278, 620); this.chkBackupVars.Name = "chkBackupVars"; this.chkBackupVars.Size = new System.Drawing.Size(87, 17); this.chkBackupVars.TabIndex = 36; diff --git a/CobXmlSupport/ShowCode.Designer.cs b/CobXmlSupport/ShowCode.Designer.cs index e8617f7..e7aa6a8 100644 --- a/CobXmlSupport/ShowCode.Designer.cs +++ b/CobXmlSupport/ShowCode.Designer.cs @@ -33,6 +33,7 @@ this.txtCode = new System.Windows.Forms.TextBox(); this.lblCodeType = new System.Windows.Forms.Label(); this.btnSynch = new System.Windows.Forms.Button(); + this.btnSynchOut = new System.Windows.Forms.Button(); this.SuspendLayout(); // // btnClose @@ -77,20 +78,33 @@ // 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(504, 642); + this.btnSynch.Location = new System.Drawing.Point(494, 642); this.btnSynch.Name = "btnSynch"; - this.btnSynch.Size = new System.Drawing.Size(95, 23); + this.btnSynch.Size = new System.Drawing.Size(105, 23); this.btnSynch.TabIndex = 3; - this.btnSynch.Text = "Synch Moves"; + this.btnSynch.Text = "Synch Moves To"; this.btnSynch.UseVisualStyleBackColor = true; this.btnSynch.Visible = false; this.btnSynch.Click += new System.EventHandler(this.btnSynch_Click); // + // 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.Name = "btnSynchOut"; + this.btnSynchOut.Size = new System.Drawing.Size(110, 23); + this.btnSynchOut.TabIndex = 4; + this.btnSynchOut.Text = "Synch Moves From"; + this.btnSynchOut.UseVisualStyleBackColor = true; + this.btnSynchOut.Visible = false; + this.btnSynchOut.Click += new System.EventHandler(this.btnSynchOut_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.btnSynchOut); this.Controls.Add(this.btnSynch); this.Controls.Add(this.lblCodeType); this.Controls.Add(this.txtCode); @@ -110,5 +124,6 @@ private System.Windows.Forms.TextBox txtCode; private System.Windows.Forms.Label lblCodeType; private System.Windows.Forms.Button btnSynch; + private System.Windows.Forms.Button btnSynchOut; } } \ No newline at end of file diff --git a/CobXmlSupport/ShowCode.cs b/CobXmlSupport/ShowCode.cs index df3b592..376d594 100644 --- a/CobXmlSupport/ShowCode.cs +++ b/CobXmlSupport/ShowCode.cs @@ -41,6 +41,7 @@ namespace CobXmlSupport { bSynch = value; btnSynch.Visible = bSynch; + btnSynchOut.Visible = bSynch; } } @@ -91,13 +92,11 @@ namespace CobXmlSupport private void btnSynch_Click(object sender, EventArgs e) { - Dictionary wrkDic = null; codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text); 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; Cc.TryFill_In_Dic(); - // wrkDic = new Dictionary(); foreach (CobRow cr in parentWindow.RowList) { if (!cr.isAttribute && !cr.SampleStr.Equals(parentWindow.NOMOVE)) @@ -116,7 +115,7 @@ namespace CobXmlSupport Cc.Save_In_Dic(); - refreshWindow(); + refreshWindow("IN"); 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; @@ -251,7 +250,7 @@ namespace CobXmlSupport } - private void refreshWindow() + private void refreshWindow(string inOut) { this.CodeShower.Text = ""; foreach (CobRow cr in parentWindow.RowList) @@ -267,20 +266,67 @@ namespace CobXmlSupport { if (this.CodeShower.Text == "") { } else this.CodeShower.Text += "\r\n"; - if (cr.MoveCode == null) + if (inOut == "IN") { - this.CodeShower.Text += "".PadRight(30) + " " + cr.FieldName.PadRight(30); + if (cr.MoveCode == null) + { + this.CodeShower.Text += "".PadRight(30) + " " + cr.FieldName.PadRight(30); + } + else + { + this.CodeShower.Text += cr.MoveCode.PadRight(30) + " " + cr.FieldName.PadRight(30); + } } else { - this.CodeShower.Text += cr.MoveCode.PadRight(30) + " " + cr.FieldName.PadRight(30); + if (cr.MoveFromCode == null) + { + this.CodeShower.Text += "".PadRight(30) + " " + cr.FieldName.PadRight(30); + + } + else + { + this.CodeShower.Text += cr.MoveFromCode.PadRight(30) + " " + cr.FieldName.PadRight(30); + } } + } } } + private void btnSynchOut_Click(object sender, EventArgs e) + { + codeCompleter Cc = new codeCompleter(parentWindow.CmbLastFile.Text); + 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(); + + // wrkDic = new Dictionary(); + foreach (CobRow cr in parentWindow.RowList) + { + if (!cr.isAttribute && !cr.SampleStr.Equals(parentWindow.NOMOVE)) + { + if (Cc.WorkDicOut != null && Cc.WorkDicOut.Count > 0) + { + if (Cc.WorkDicOut.TryGetValue(cr.FieldName, out fieldCompl)) + { + cr.MoveFromCode = fieldCompl; + } + } + if (cr.MoveFromCode == null) { cr.MoveFromCode = " "; } + Cc.WorkDicOut[cr.FieldName] = cr.MoveFromCode; + } + } + + Cc.Save_Out_Dic(); + + refreshWindow("OUT"); + + 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; + } + } }