new files from cobxml
This commit is contained in:
@ -52,6 +52,11 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="savedFile.cs" />
|
||||||
|
<Compile Include="SaveRegCopyFile.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SaveRegCopyFile.Designer.cs" />
|
||||||
<Compile Include="ShowCode.cs">
|
<Compile Include="ShowCode.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -69,6 +74,7 @@
|
|||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<EmbeddedResource Include="SaveRegCopyFile.resx" />
|
||||||
<EmbeddedResource Include="ShowCode.resx" />
|
<EmbeddedResource Include="ShowCode.resx" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
|||||||
147
CobProgAid/CobProgAid/SaveRegCopyFile.Designer.cs
generated
Normal file
147
CobProgAid/CobProgAid/SaveRegCopyFile.Designer.cs
generated
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
namespace CobProgAid
|
||||||
|
{
|
||||||
|
partial class SaveRegCopyFile
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.txtUsageName = new System.Windows.Forms.TextBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.btnChooseFnameAndPlace = new System.Windows.Forms.Button();
|
||||||
|
this.txtChosenDirectory = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtFileName = new System.Windows.Forms.TextBox();
|
||||||
|
this.btnSave = new System.Windows.Forms.Button();
|
||||||
|
this.btnCancel = new System.Windows.Forms.Button();
|
||||||
|
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.label1.Location = new System.Drawing.Point(29, 26);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(134, 20);
|
||||||
|
this.label1.TabIndex = 0;
|
||||||
|
this.label1.Text = "Spara aktuell fil";
|
||||||
|
//
|
||||||
|
// txtUsageName
|
||||||
|
//
|
||||||
|
this.txtUsageName.Location = new System.Drawing.Point(167, 68);
|
||||||
|
this.txtUsageName.Name = "txtUsageName";
|
||||||
|
this.txtUsageName.Size = new System.Drawing.Size(308, 20);
|
||||||
|
this.txtUsageName.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(30, 71);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(95, 13);
|
||||||
|
this.label2.TabIndex = 2;
|
||||||
|
this.label2.Text = "Användningsnamn";
|
||||||
|
//
|
||||||
|
// btnChooseFnameAndPlace
|
||||||
|
//
|
||||||
|
this.btnChooseFnameAndPlace.Location = new System.Drawing.Point(33, 104);
|
||||||
|
this.btnChooseFnameAndPlace.Name = "btnChooseFnameAndPlace";
|
||||||
|
this.btnChooseFnameAndPlace.Size = new System.Drawing.Size(92, 23);
|
||||||
|
this.btnChooseFnameAndPlace.TabIndex = 3;
|
||||||
|
this.btnChooseFnameAndPlace.Text = "Välj sparplats";
|
||||||
|
this.btnChooseFnameAndPlace.UseVisualStyleBackColor = true;
|
||||||
|
this.btnChooseFnameAndPlace.Click += new System.EventHandler(this.btnChooseFnameAndPlace_Click);
|
||||||
|
//
|
||||||
|
// txtChosenDirectory
|
||||||
|
//
|
||||||
|
this.txtChosenDirectory.Location = new System.Drawing.Point(167, 104);
|
||||||
|
this.txtChosenDirectory.Name = "txtChosenDirectory";
|
||||||
|
this.txtChosenDirectory.ReadOnly = true;
|
||||||
|
this.txtChosenDirectory.Size = new System.Drawing.Size(308, 20);
|
||||||
|
this.txtChosenDirectory.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// txtFileName
|
||||||
|
//
|
||||||
|
this.txtFileName.Location = new System.Drawing.Point(167, 142);
|
||||||
|
this.txtFileName.Name = "txtFileName";
|
||||||
|
this.txtFileName.ReadOnly = true;
|
||||||
|
this.txtFileName.Size = new System.Drawing.Size(308, 20);
|
||||||
|
this.txtFileName.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
this.btnSave.Location = new System.Drawing.Point(400, 183);
|
||||||
|
this.btnSave.Name = "btnSave";
|
||||||
|
this.btnSave.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.btnSave.TabIndex = 6;
|
||||||
|
this.btnSave.Text = "Spara";
|
||||||
|
this.btnSave.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||||
|
//
|
||||||
|
// btnCancel
|
||||||
|
//
|
||||||
|
this.btnCancel.Location = new System.Drawing.Point(319, 183);
|
||||||
|
this.btnCancel.Name = "btnCancel";
|
||||||
|
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.btnCancel.TabIndex = 7;
|
||||||
|
this.btnCancel.Text = "Avbryt";
|
||||||
|
this.btnCancel.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||||
|
//
|
||||||
|
// SaveRegCopyFile
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(503, 233);
|
||||||
|
this.Controls.Add(this.btnCancel);
|
||||||
|
this.Controls.Add(this.btnSave);
|
||||||
|
this.Controls.Add(this.txtFileName);
|
||||||
|
this.Controls.Add(this.txtChosenDirectory);
|
||||||
|
this.Controls.Add(this.btnChooseFnameAndPlace);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.txtUsageName);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Name = "SaveRegCopyFile";
|
||||||
|
this.Text = "Spara och Registrera skapad fil";
|
||||||
|
this.Load += new System.EventHandler(this.SaveRegCopyFile_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.TextBox txtUsageName;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Button btnChooseFnameAndPlace;
|
||||||
|
private System.Windows.Forms.TextBox txtChosenDirectory;
|
||||||
|
private System.Windows.Forms.TextBox txtFileName;
|
||||||
|
private System.Windows.Forms.Button btnSave;
|
||||||
|
private System.Windows.Forms.Button btnCancel;
|
||||||
|
private System.Windows.Forms.SaveFileDialog saveFileDialog;
|
||||||
|
}
|
||||||
|
}
|
||||||
74
CobProgAid/CobProgAid/SaveRegCopyFile.cs
Normal file
74
CobProgAid/CobProgAid/SaveRegCopyFile.cs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.IO;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace CobProgAid
|
||||||
|
{
|
||||||
|
public partial class SaveRegCopyFile : Form
|
||||||
|
{
|
||||||
|
public savedFile SavedFile { get; set; }
|
||||||
|
public string FileData { get; set; }
|
||||||
|
public string finalFileName { get; set; }
|
||||||
|
|
||||||
|
public SaveRegCopyFile()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnChooseFnameAndPlace_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
saveFileDialog.Title = "Välj plats för den aktuella filen !";
|
||||||
|
saveFileDialog.Filter = "Copy files (*.cpy)|*.cpy|Cobol code (*.cbl)|*.cbl|Text Files (*.txt)|*.txt|All files (*.*)|*.*";
|
||||||
|
saveFileDialog.FileName = SavedFile.fNameSaved;
|
||||||
|
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
SavedFile.fNameSaved = txtFileName.Text = saveFileDialog.FileName.Substring(saveFileDialog.FileName.LastIndexOf("\\") + 1); ;
|
||||||
|
SavedFile.directorySaved = txtChosenDirectory.Text = saveFileDialog.FileName.Substring(0, saveFileDialog.FileName.LastIndexOf("\\"));
|
||||||
|
SavedFile.usageName = txtUsageName.Text;
|
||||||
|
if (SavedFile.idConnect.Length > 0)
|
||||||
|
{
|
||||||
|
btnSave.Enabled = true;
|
||||||
|
}
|
||||||
|
else MessageBox.Show("idConnect för filtypen saknas !");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.finalFileName = saveFileDialog.FileName;
|
||||||
|
File.WriteAllText(saveFileDialog.FileName, FileData);
|
||||||
|
SavedFile.saveDate = DateTime.Now;
|
||||||
|
savedFile tmpSF = new savedFile();
|
||||||
|
//tmpSF = (savedFile)SavedFile.Clone();
|
||||||
|
//S.ettingListAdd(tmpSF);
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Problem att spara :\r\n" + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveRegCopyFile_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
txtUsageName.Text = SavedFile.usageName;
|
||||||
|
txtChosenDirectory.Text = "";
|
||||||
|
txtFileName.Text = "";
|
||||||
|
btnSave.Enabled = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
123
CobProgAid/CobProgAid/SaveRegCopyFile.resx
Normal file
123
CobProgAid/CobProgAid/SaveRegCopyFile.resx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
||||||
2
CobProgAid/CobProgAid/ShowCode.Designer.cs
generated
2
CobProgAid/CobProgAid/ShowCode.Designer.cs
generated
@ -1,4 +1,4 @@
|
|||||||
namespace CobXmlSupport
|
namespace CobProgAid
|
||||||
{
|
{
|
||||||
partial class ShowCode
|
partial class ShowCode
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,17 +9,16 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
|
|
||||||
namespace CobXmlSupport
|
namespace CobProgAid
|
||||||
{
|
{
|
||||||
public partial class ShowCode : Form
|
public partial class ShowCode : Form
|
||||||
{
|
{
|
||||||
|
|
||||||
public readonly string CSV = ".csv";
|
//public readonly string CSV = ".csv";
|
||||||
public readonly string DIF = ".dif";
|
//public readonly string DIF = ".dif";
|
||||||
public readonly string JSON = ".json";
|
//public readonly string JSON = ".json";
|
||||||
|
|
||||||
string oldTxt;
|
string oldTxt;
|
||||||
bool bSynch;
|
bool bSynch;
|
||||||
@ -60,9 +59,9 @@ namespace CobXmlSupport
|
|||||||
set { lblCodeType.Text = value; }
|
set { lblCodeType.Text = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private GenCobCode parentWindow;
|
private frmProgAidHome parentWindow;
|
||||||
|
|
||||||
public GenCobCode Parent
|
public frmProgAidHome Parent
|
||||||
{
|
{
|
||||||
get { return parentWindow; }
|
get { return parentWindow; }
|
||||||
set { parentWindow = value; }
|
set { parentWindow = value; }
|
||||||
@ -95,47 +94,36 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
private void btnSynch_Click(object sender, EventArgs e)
|
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 = "";
|
//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();
|
//Cc.TryFill_In_Dic();
|
||||||
|
|
||||||
foreach (CobRow cr in parentWindow.RowList)
|
//foreach (CobRow cr in parentWindow.RowList)
|
||||||
{
|
//{
|
||||||
if (!cr.isAttribute && !cr.SampleStr.Equals(parentWindow.NOMOVE))
|
// if (!cr.isAttribute && !cr.SampleStr.Equals(parentWindow.NOMOVE))
|
||||||
{
|
// {
|
||||||
if (Cc.WorkDicIn != null && Cc.WorkDicIn.Count > 0)
|
// if (Cc.WorkDicIn != null && Cc.WorkDicIn.Count > 0)
|
||||||
{
|
// {
|
||||||
if (Cc.WorkDicIn.TryGetValue(cr.FieldName, out fieldCompl))
|
// if (Cc.WorkDicIn.TryGetValue(cr.FieldName, out fieldCompl))
|
||||||
{
|
// {
|
||||||
cr.MoveCode = fieldCompl;
|
// cr.MoveCode = fieldCompl;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (cr.MoveCode == null) { cr.MoveCode = " "; }
|
// if (cr.MoveCode == null) { cr.MoveCode = " "; }
|
||||||
Cc.WorkDicIn[cr.FieldName]=cr.MoveCode;
|
// Cc.WorkDicIn[cr.FieldName]=cr.MoveCode;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
Cc.Save_In_Dic();
|
//Cc.Save_In_Dic();
|
||||||
|
|
||||||
refreshWindow("IN");
|
//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;
|
//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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dictionary<string, string> moveJsonFieldDictionary(string ccIn)
|
|
||||||
{
|
|
||||||
Dictionary<string, string> tmpDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(ccIn);
|
|
||||||
return tmpDic;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string createJsonFromDic(Dictionary<string, string> wrkDic)
|
|
||||||
{
|
|
||||||
string tmpJson = JsonConvert.SerializeObject(wrkDic);
|
|
||||||
return tmpJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string deQuote(string inString)
|
private string deQuote(string inString)
|
||||||
{
|
{
|
||||||
string tmpStr = "";
|
string tmpStr = "";
|
||||||
@ -176,159 +164,38 @@ namespace CobXmlSupport
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Dictionary<string, string> moveFieldDictionary(string inFil)
|
|
||||||
{
|
|
||||||
Dictionary<string, string> tmpDic = new Dictionary<string, string>();
|
|
||||||
string[] splits = { "\r\n" };
|
|
||||||
string[] itemPairs = inFil.Split(splits, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
char[] newSplits = { '\t' };
|
|
||||||
foreach (string itemPair in itemPairs)
|
|
||||||
{
|
|
||||||
string[] items = itemPair.Split(newSplits);
|
|
||||||
tmpDic.Add(items[0], items[1].Replace("\n", "\r\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return tmpDic;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Dictionary<string, string> moveDifFieldDictionary(string inFil)
|
|
||||||
{
|
|
||||||
bool TABLE = false, VECTORS = false, TUPLES = false, DATA = false;
|
|
||||||
int rows = 0, rowCount = 0;
|
|
||||||
Dictionary<string, string> tmpDic = new Dictionary<string, string>();
|
|
||||||
string[] splits = { "\r\n" };
|
|
||||||
char[] csplit = { ',' };
|
|
||||||
string[] items = inFil.Split(splits, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
for (int i = 0; i < items.Count(); i++)
|
|
||||||
{
|
|
||||||
string item = items[i];
|
|
||||||
switch (item.ToUpper())
|
|
||||||
{
|
|
||||||
case "TABLE":
|
|
||||||
{
|
|
||||||
TABLE = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "VECTORS":
|
|
||||||
{
|
|
||||||
VECTORS = true;
|
|
||||||
string[] nums = items[i + 1].Split(csplit);
|
|
||||||
rows = int.Parse(nums[1]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "TUPLES":
|
|
||||||
{
|
|
||||||
TUPLES = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case "DATA":
|
|
||||||
{
|
|
||||||
DATA = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case "BOT":
|
|
||||||
{
|
|
||||||
if (TABLE && VECTORS && TUPLES && DATA)
|
|
||||||
{
|
|
||||||
if (rowCount < rows)
|
|
||||||
{
|
|
||||||
tmpDic.Add(deQuote(items[i + 2]), items[i + 4].Replace("\n", "\r\n"));
|
|
||||||
rowCount++;
|
|
||||||
i = i + 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "EOD":
|
|
||||||
{
|
|
||||||
i = items.Count();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tmpDic;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void refreshWindow(string inOut)
|
|
||||||
{
|
|
||||||
this.CodeShower.Text = "";
|
|
||||||
foreach (CobRow cr in parentWindow.RowList)
|
|
||||||
{
|
|
||||||
if (cr.CobLevel < 2)
|
|
||||||
{
|
|
||||||
string inFile = parentWindow.CmbLastFile.Text.Substring(parentWindow.CmbLastFile.Text.LastIndexOf("\\") + 1);
|
|
||||||
parentWindow.CreateComment(this.CodeShower, "Moves reference (with loop) " + cr.FieldName, S.ettingUserName, S.ettingCompany, inFile);
|
|
||||||
}
|
|
||||||
// Header square created
|
|
||||||
|
|
||||||
if (!cr.isAttribute && !cr.SampleStr.Equals(parentWindow.NOMOVE))
|
|
||||||
{
|
|
||||||
if (this.CodeShower.Text == "") { }
|
|
||||||
else this.CodeShower.Text += "\r\n";
|
|
||||||
if (inOut == "IN")
|
|
||||||
{
|
|
||||||
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
|
|
||||||
{
|
|
||||||
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)
|
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 = "";
|
//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;
|
//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();
|
//Cc.TryFill_Out_Dic();
|
||||||
|
|
||||||
// wrkDic = new Dictionary<string, string>();
|
//// wrkDic = new Dictionary<string, string>();
|
||||||
foreach (CobRow cr in parentWindow.RowList)
|
//foreach (CobRow cr in parentWindow.RowList)
|
||||||
{
|
//{
|
||||||
if (!cr.isAttribute && !cr.SampleStr.Equals(parentWindow.NOMOVE))
|
// if (!cr.isAttribute && !cr.SampleStr.Equals(parentWindow.NOMOVE))
|
||||||
{
|
// {
|
||||||
if (Cc.WorkDicOut != null && Cc.WorkDicOut.Count > 0)
|
// if (Cc.WorkDicOut != null && Cc.WorkDicOut.Count > 0)
|
||||||
{
|
// {
|
||||||
if (Cc.WorkDicOut.TryGetValue(cr.FieldName, out fieldCompl))
|
// if (Cc.WorkDicOut.TryGetValue(cr.FieldName, out fieldCompl))
|
||||||
{
|
// {
|
||||||
cr.MoveFromCode = fieldCompl;
|
// cr.MoveFromCode = fieldCompl;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (cr.MoveFromCode == null) { cr.MoveFromCode = " "; }
|
// if (cr.MoveFromCode == null) { cr.MoveFromCode = " "; }
|
||||||
Cc.WorkDicOut[cr.FieldName] = cr.MoveFromCode;
|
// Cc.WorkDicOut[cr.FieldName] = cr.MoveFromCode;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
Cc.Save_Out_Dic();
|
//Cc.Save_Out_Dic();
|
||||||
|
|
||||||
refreshWindow("OUT");
|
//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;
|
//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;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnSaveAktualText_Click(object sender, EventArgs e)
|
private void btnSaveAktualText_Click(object sender, EventArgs e)
|
||||||
|
|||||||
33
CobProgAid/CobProgAid/savedFile.cs
Normal file
33
CobProgAid/CobProgAid/savedFile.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace CobProgAid
|
||||||
|
{
|
||||||
|
public class savedFile : ICloneable
|
||||||
|
{
|
||||||
|
public savedFile()
|
||||||
|
{
|
||||||
|
idConnect = "";
|
||||||
|
usageName = "";
|
||||||
|
directorySaved = "";
|
||||||
|
fNameSaved = "";
|
||||||
|
saveDate = DateTime.MinValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string idConnect;
|
||||||
|
public string usageName;
|
||||||
|
public string directorySaved;
|
||||||
|
public string fNameSaved;
|
||||||
|
public DateTime saveDate;
|
||||||
|
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
savedFile tmpSF = new savedFile();
|
||||||
|
tmpSF = (savedFile)this.MemberwiseClone();
|
||||||
|
return tmpSF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user