Info per file implemented (more testing required)
This commit is contained in:
12
CobXmlSupport/GenCobCode.Designer.cs
generated
12
CobXmlSupport/GenCobCode.Designer.cs
generated
@ -175,12 +175,13 @@
|
|||||||
this.txtPrefix.Size = new System.Drawing.Size(57, 20);
|
this.txtPrefix.Size = new System.Drawing.Size(57, 20);
|
||||||
this.txtPrefix.TabIndex = 10;
|
this.txtPrefix.TabIndex = 10;
|
||||||
this.txtPrefix.Text = "GWM_";
|
this.txtPrefix.Text = "GWM_";
|
||||||
|
this.txtPrefix.TextChanged += new System.EventHandler(this.txtPrefix_TextChanged);
|
||||||
//
|
//
|
||||||
// chkWrap
|
// chkWrap
|
||||||
//
|
//
|
||||||
this.chkWrap.AutoSize = true;
|
this.chkWrap.AutoSize = true;
|
||||||
this.chkWrap.Location = new System.Drawing.Point(389, 73);
|
this.chkWrap.Location = new System.Drawing.Point(389, 73);
|
||||||
this.chkWrap.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
this.chkWrap.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.chkWrap.Name = "chkWrap";
|
this.chkWrap.Name = "chkWrap";
|
||||||
this.chkWrap.Size = new System.Drawing.Size(79, 17);
|
this.chkWrap.Size = new System.Drawing.Size(79, 17);
|
||||||
this.chkWrap.TabIndex = 11;
|
this.chkWrap.TabIndex = 11;
|
||||||
@ -193,7 +194,7 @@
|
|||||||
this.btnGenICode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.btnGenICode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.btnGenICode.Enabled = false;
|
this.btnGenICode.Enabled = false;
|
||||||
this.btnGenICode.Location = new System.Drawing.Point(410, 616);
|
this.btnGenICode.Location = new System.Drawing.Point(410, 616);
|
||||||
this.btnGenICode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
this.btnGenICode.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.btnGenICode.Name = "btnGenICode";
|
this.btnGenICode.Name = "btnGenICode";
|
||||||
this.btnGenICode.Size = new System.Drawing.Size(81, 23);
|
this.btnGenICode.Size = new System.Drawing.Size(81, 23);
|
||||||
this.btnGenICode.TabIndex = 12;
|
this.btnGenICode.TabIndex = 12;
|
||||||
@ -205,7 +206,7 @@
|
|||||||
//
|
//
|
||||||
this.chkUnique.AutoSize = true;
|
this.chkUnique.AutoSize = true;
|
||||||
this.chkUnique.Location = new System.Drawing.Point(503, 74);
|
this.chkUnique.Location = new System.Drawing.Point(503, 74);
|
||||||
this.chkUnique.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
this.chkUnique.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.chkUnique.Name = "chkUnique";
|
this.chkUnique.Name = "chkUnique";
|
||||||
this.chkUnique.Size = new System.Drawing.Size(95, 17);
|
this.chkUnique.Size = new System.Drawing.Size(95, 17);
|
||||||
this.chkUnique.TabIndex = 13;
|
this.chkUnique.TabIndex = 13;
|
||||||
@ -218,7 +219,7 @@
|
|||||||
this.btnMoves.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.btnMoves.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.btnMoves.Enabled = false;
|
this.btnMoves.Enabled = false;
|
||||||
this.btnMoves.Location = new System.Drawing.Point(495, 616);
|
this.btnMoves.Location = new System.Drawing.Point(495, 616);
|
||||||
this.btnMoves.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
this.btnMoves.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.btnMoves.Name = "btnMoves";
|
this.btnMoves.Name = "btnMoves";
|
||||||
this.btnMoves.Size = new System.Drawing.Size(93, 23);
|
this.btnMoves.Size = new System.Drawing.Size(93, 23);
|
||||||
this.btnMoves.TabIndex = 14;
|
this.btnMoves.TabIndex = 14;
|
||||||
@ -350,7 +351,7 @@
|
|||||||
//
|
//
|
||||||
this.btnSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.btnSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.btnSettings.Location = new System.Drawing.Point(20, 616);
|
this.btnSettings.Location = new System.Drawing.Point(20, 616);
|
||||||
this.btnSettings.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
this.btnSettings.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.btnSettings.Name = "btnSettings";
|
this.btnSettings.Name = "btnSettings";
|
||||||
this.btnSettings.Size = new System.Drawing.Size(81, 23);
|
this.btnSettings.Size = new System.Drawing.Size(81, 23);
|
||||||
this.btnSettings.TabIndex = 26;
|
this.btnSettings.TabIndex = 26;
|
||||||
@ -409,6 +410,7 @@
|
|||||||
this.txtExpPrefix.Size = new System.Drawing.Size(57, 20);
|
this.txtExpPrefix.Size = new System.Drawing.Size(57, 20);
|
||||||
this.txtExpPrefix.TabIndex = 31;
|
this.txtExpPrefix.TabIndex = 31;
|
||||||
this.txtExpPrefix.Text = "GWX_";
|
this.txtExpPrefix.Text = "GWX_";
|
||||||
|
this.txtExpPrefix.TextChanged += new System.EventHandler(this.txtExpPrefix_TextChanged);
|
||||||
//
|
//
|
||||||
// chkAttribs
|
// chkAttribs
|
||||||
//
|
//
|
||||||
|
|||||||
@ -14,6 +14,7 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Resources;
|
using System.Resources;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
//---------------------------förändrings krav---------------------------
|
//---------------------------förändrings krav---------------------------
|
||||||
// 1.) Indexerande mellannivåer där count-måste sättas får inte hoppas över !
|
// 1.) Indexerande mellannivåer där count-måste sättas får inte hoppas över !
|
||||||
@ -39,6 +40,9 @@ namespace CobXmlSupport
|
|||||||
private string indTemp = "";
|
private string indTemp = "";
|
||||||
private char[] splitChars = { '#' };
|
private char[] splitChars = { '#' };
|
||||||
|
|
||||||
|
Dictionary<string, GenSetting> setObjs; // = new Dictionary<string, GenSetting>();
|
||||||
|
SaverListener sl;
|
||||||
|
|
||||||
//private string SettingUserName, SettingCompany;
|
//private string SettingUserName, SettingCompany;
|
||||||
////-------------------------
|
////-------------------------
|
||||||
//private bool SettingNoNsRef;
|
//private bool SettingNoNsRef;
|
||||||
@ -79,10 +83,21 @@ namespace CobXmlSupport
|
|||||||
public GenCobCode()
|
public GenCobCode()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
setObjs = new Dictionary<string, GenSetting>();
|
||||||
|
sl = new SaverListener();
|
||||||
|
sl.dict = setObjs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingActualFile = cmbLastFile.Text.Substring(cmbLastFile.Text.LastIndexOf("\\") + 1);
|
||||||
|
GenSetting tmpGS = null;
|
||||||
|
sl.dict.TryGetValue(S.ettingActualFile, out tmpGS);
|
||||||
|
if (tmpGS != null)
|
||||||
|
{
|
||||||
|
tmpGS.SetSettings();
|
||||||
|
setLocalValues();
|
||||||
|
}
|
||||||
runXMLgen();
|
runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +115,16 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
if (cmbLastFile.Text.Length > 0)
|
if (cmbLastFile.Text.Length > 0)
|
||||||
{
|
{
|
||||||
|
S.ettingActualFile = cmbLastFile.Text.Substring(cmbLastFile.Text.LastIndexOf("\\") + 1);
|
||||||
|
//GenSetting tmpGS=null;
|
||||||
|
//sl.dict.TryGetValue(S.ettingActualFile, out tmpGS);
|
||||||
|
//if (tmpGS != null)
|
||||||
|
//{
|
||||||
|
// tmpGS.SetSettings();
|
||||||
|
// setLocalValues();
|
||||||
|
//}
|
||||||
|
|
||||||
|
S.ettingFilePath = cmbLastFile.Text.Substring(0,cmbLastFile.Text.LastIndexOf("\\"));
|
||||||
uniqueTags = new Dictionary<string, string>();
|
uniqueTags = new Dictionary<string, string>();
|
||||||
uniqueAttr = new Dictionary<string, string>();
|
uniqueAttr = new Dictionary<string, string>();
|
||||||
uniqueVars = new Dictionary<string, string>();
|
uniqueVars = new Dictionary<string, string>();
|
||||||
@ -683,6 +708,29 @@ namespace CobXmlSupport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DeserializeMetaData()
|
||||||
|
{
|
||||||
|
|
||||||
|
string SavePath = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]).ToString();
|
||||||
|
|
||||||
|
GenSetting[] saveColl = null;
|
||||||
|
setObjs = new Dictionary<string, GenSetting>();
|
||||||
|
|
||||||
|
if (File.Exists(SavePath + "\\FilnamnsDict.xml"))
|
||||||
|
{
|
||||||
|
XmlSerializer x = new XmlSerializer(typeof(GenSetting[]));
|
||||||
|
StreamReader reader = new StreamReader(SavePath + "\\FilnamnsDict.xml");
|
||||||
|
saveColl = (GenSetting[])x.Deserialize(reader);
|
||||||
|
|
||||||
|
foreach (GenSetting g in saveColl)
|
||||||
|
{
|
||||||
|
setObjs.Add(g.ActualFile, g);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sl.dict = setObjs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Form1_Load(object sender, EventArgs e)
|
private void Form1_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -697,11 +745,24 @@ namespace CobXmlSupport
|
|||||||
chkWrap.Checked = true;
|
chkWrap.Checked = true;
|
||||||
chkNewArea.Checked = false;
|
chkNewArea.Checked = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cmbLastFile.Items.Clear();
|
cmbLastFile.Items.Clear();
|
||||||
foreach (string usedFile in Properties.Settings.Default.LastFile)
|
foreach (string usedFile in Properties.Settings.Default.LastFile)
|
||||||
{
|
{
|
||||||
cmbLastFile.Items.Add(usedFile);
|
cmbLastFile.Items.Add(usedFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeserializeMetaData();
|
||||||
|
if (sl.dict.Count > 0)
|
||||||
|
{
|
||||||
|
cmbLastFile.Items.Clear();
|
||||||
|
foreach (GenSetting x in sl.dict.Values)
|
||||||
|
{
|
||||||
|
cmbLastFile.Items.Add(x.FilePath + "\\" + x.ActualFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
S.ettingUserName = Properties.Settings.Default.UserName;
|
S.ettingUserName = Properties.Settings.Default.UserName;
|
||||||
S.ettingCompany = Properties.Settings.Default.CompanyName;
|
S.ettingCompany = Properties.Settings.Default.CompanyName;
|
||||||
|
|
||||||
@ -741,6 +802,7 @@ namespace CobXmlSupport
|
|||||||
{
|
{
|
||||||
cmbLastFile.Text = cmbLastFile.Items[0].ToString();
|
cmbLastFile.Text = cmbLastFile.Items[0].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnClose_Click(object sender, EventArgs e)
|
private void btnClose_Click(object sender, EventArgs e)
|
||||||
@ -1132,8 +1194,36 @@ namespace CobXmlSupport
|
|||||||
Properties.Settings.Default.CompanyName = S.ettingCompany;
|
Properties.Settings.Default.CompanyName = S.ettingCompany;
|
||||||
Properties.Settings.Default.UserName = S.ettingUserName;
|
Properties.Settings.Default.UserName = S.ettingUserName;
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
|
|
||||||
|
|
||||||
|
SerializeMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SerializeMetadata()
|
||||||
|
{
|
||||||
|
string SavePath = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]).ToString();
|
||||||
|
GenSetting[] saveColl = new GenSetting[setObjs.Count];
|
||||||
|
int i = 0;
|
||||||
|
foreach (GenSetting x in setObjs.Values)
|
||||||
|
{
|
||||||
|
saveColl[i++] = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
XmlSerializer x = new XmlSerializer(saveColl.GetType());
|
||||||
|
StreamWriter writer = new StreamWriter(SavePath + "\\FilnamnsDict.xml", false);
|
||||||
|
x.Serialize(writer, saveColl);
|
||||||
|
MessageBox.Show("Objektet är serialiserat !(" + SavePath + "\\FilnamnsDict.xml)");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Serialisering : " + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnClearSettings_Click(object sender, EventArgs e)
|
private void btnClearSettings_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
cmbLastFile.Items.Clear();
|
cmbLastFile.Items.Clear();
|
||||||
@ -1142,11 +1232,13 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
private void chkWrap_CheckedChanged(object sender, EventArgs e)
|
private void chkWrap_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingWrap = chkWrap.Checked;
|
||||||
if (!eventRun) runXMLgen();
|
if (!eventRun) runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkNoNsRef_CheckedChanged(object sender, EventArgs e)
|
private void chkNoNsRef_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingNoNsRef = chkNoNsRef.Checked;
|
||||||
if (!eventRun)
|
if (!eventRun)
|
||||||
{
|
{
|
||||||
eventRun = true;
|
eventRun = true;
|
||||||
@ -1158,31 +1250,37 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
private void chkAnaTag_CheckedChanged(object sender, EventArgs e)
|
private void chkAnaTag_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingAnaTag = chkAnaTag.Checked;
|
||||||
if (!eventRun) runXMLgen();
|
if (!eventRun) runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkValues_CheckedChanged(object sender, EventArgs e)
|
private void chkValues_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingValues = chkValues.Checked;
|
||||||
if (!eventRun) runXMLgen();
|
if (!eventRun) runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkUniqueAttrVars_CheckedChanged(object sender, EventArgs e)
|
private void chkUniqueAttrVars_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingUniqueAttrVars = chkUniqueAttrVars.Checked;
|
||||||
if (!eventRun) runXMLgen();
|
if (!eventRun) runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkUnique_CheckedChanged(object sender, EventArgs e)
|
private void chkUnique_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingUnique = chkUnique.Checked;
|
||||||
if (!eventRun) runXMLgen();
|
if (!eventRun) runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkUniqueVars_CheckedChanged(object sender, EventArgs e)
|
private void chkUniqueVars_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingUniqueVars = chkUniqueVars.Checked;
|
||||||
if (!eventRun) runXMLgen();
|
if (!eventRun) runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkCountVars_CheckedChanged(object sender, EventArgs e)
|
private void chkCountVars_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
S.ettingCountVars = chkCountVars.Checked;
|
||||||
if (!eventRun) runXMLgen();
|
if (!eventRun) runXMLgen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1191,52 +1289,79 @@ namespace CobXmlSupport
|
|||||||
if (setWindow == null)
|
if (setWindow == null)
|
||||||
{
|
{
|
||||||
setWindow = new frmSettings();
|
setWindow = new frmSettings();
|
||||||
|
setWindow.SL = this.sl;
|
||||||
|
setWindow.SettingObj = new GenSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
eventRun = true;
|
eventRun = true;
|
||||||
|
|
||||||
setWindow.UserName = S.ettingUserName;
|
//setWindow.UserName = S.ettingUserName;
|
||||||
setWindow.CompanyName = S.ettingCompany;
|
//setWindow.CompanyName = S.ettingCompany;
|
||||||
|
|
||||||
setWindow.AktualFile = S.ettingActualFile;
|
//setWindow.AktualFile = S.ettingActualFile;
|
||||||
setWindow.FilePath = S.ettingFilePath;
|
//setWindow.FilePath = S.ettingFilePath;
|
||||||
|
|
||||||
setWindow.ChkNoNsRef = S.ettingNoNsRef;
|
//setWindow.ChkNoNsRef = S.ettingNoNsRef;
|
||||||
setWindow.ChkUniqueVars = S.ettingUniqueVars;
|
//setWindow.ChkUniqueVars = S.ettingUniqueVars;
|
||||||
setWindow.ChkUniqueAttrVars = S.ettingUniqueAttrVars;
|
//setWindow.ChkUniqueAttrVars = S.ettingUniqueAttrVars;
|
||||||
setWindow.ChkUnique = S.ettingUnique;
|
//setWindow.ChkUnique = S.ettingUnique;
|
||||||
setWindow.ChkWrap = S.ettingWrap;
|
//setWindow.ChkWrap = S.ettingWrap;
|
||||||
setWindow.ChkValues = S.ettingValues;
|
//setWindow.ChkValues = S.ettingValues;
|
||||||
setWindow.ChkAnaTag = S.ettingAnaTag;
|
//setWindow.ChkAnaTag = S.ettingAnaTag;
|
||||||
setWindow.TxtPrefix = S.ettingPrefix;
|
//setWindow.TxtPrefix = S.ettingPrefix;
|
||||||
setWindow.TxtExpPrefix = S.ettingExpPrefix;
|
//setWindow.TxtExpPrefix = S.ettingExpPrefix;
|
||||||
setWindow.TxtMaxOcc = S.ettingMaxOcc;
|
//setWindow.TxtMaxOcc = S.ettingMaxOcc;
|
||||||
setWindow.ChkCountVars = S.ettingCountVars;
|
//setWindow.ChkCountVars = S.ettingCountVars;
|
||||||
setWindow.LogPost = S.ettingLogVarName;
|
//setWindow.LogPost = S.ettingLogVarName;
|
||||||
setWindow.LogSection = S.ettingLogSectName;
|
//setWindow.LogSection = S.ettingLogSectName;
|
||||||
setWindow.ChkShowTestbtns = S.ettingSpecials;
|
//setWindow.ChkShowTestbtns = S.ettingSpecials;
|
||||||
setWindow.ChkBackupOwnCode = S.ettingUserCodeBcup;
|
//setWindow.ChkBackupOwnCode = S.ettingUserCodeBcup;
|
||||||
|
|
||||||
setWindow.ShowDialog();
|
setWindow.ShowDialog();
|
||||||
|
|
||||||
S.ettingUserName = setWindow.UserName;
|
//S.ettingUserName = setWindow.UserName;
|
||||||
S.ettingCompany = setWindow.CompanyName;
|
//S.ettingCompany = setWindow.CompanyName;
|
||||||
S.ettingNoNsRef = setWindow.ChkNoNsRef;
|
//S.ettingNoNsRef = setWindow.ChkNoNsRef;
|
||||||
S.ettingUniqueVars = setWindow.ChkUniqueVars;
|
//S.ettingUniqueVars = setWindow.ChkUniqueVars;
|
||||||
S.ettingUniqueAttrVars = setWindow.ChkUniqueAttrVars;
|
//S.ettingUniqueAttrVars = setWindow.ChkUniqueAttrVars;
|
||||||
S.ettingUnique = setWindow.ChkUnique;
|
//S.ettingUnique = setWindow.ChkUnique;
|
||||||
S.ettingWrap = setWindow.ChkWrap;
|
//S.ettingWrap = setWindow.ChkWrap;
|
||||||
S.ettingValues = setWindow.ChkValues;
|
//S.ettingValues = setWindow.ChkValues;
|
||||||
S.ettingAnaTag = setWindow.ChkAnaTag;
|
//S.ettingAnaTag = setWindow.ChkAnaTag;
|
||||||
S.ettingPrefix = setWindow.TxtPrefix;
|
//S.ettingPrefix = setWindow.TxtPrefix;
|
||||||
S.ettingExpPrefix = setWindow.TxtExpPrefix;
|
//S.ettingExpPrefix = setWindow.TxtExpPrefix;
|
||||||
S.ettingMaxOcc = setWindow.TxtMaxOcc;
|
//S.ettingMaxOcc = setWindow.TxtMaxOcc;
|
||||||
S.ettingCountVars = setWindow.ChkCountVars;
|
//S.ettingCountVars = setWindow.ChkCountVars;
|
||||||
S.ettingLogVarName = setWindow.LogPost;
|
//S.ettingLogVarName = setWindow.LogPost;
|
||||||
S.ettingLogSectName = setWindow.LogSection;
|
//S.ettingLogSectName = setWindow.LogSection;
|
||||||
S.ettingSpecials = setWindow.ChkShowTestbtns;
|
//S.ettingSpecials = setWindow.ChkShowTestbtns;
|
||||||
S.ettingUserCodeBcup = setWindow.ChkBackupOwnCode;
|
//S.ettingUserCodeBcup = setWindow.ChkBackupOwnCode;
|
||||||
|
|
||||||
|
setLocalValues();
|
||||||
|
|
||||||
|
//chkAnaTag.Checked = S.ettingAnaTag;
|
||||||
|
//chkCountVars.Checked = S.ettingCountVars;
|
||||||
|
//chkDisplays.Checked = true;
|
||||||
|
//chkNoNsRef.Checked = S.ettingNoNsRef;
|
||||||
|
//chkUnique.Checked = S.ettingUnique;
|
||||||
|
//chkUniqueAttrVars.Checked = S.ettingUniqueAttrVars;
|
||||||
|
//chkUniqueVars.Checked = S.ettingUniqueVars;
|
||||||
|
//chkValues.Checked = S.ettingValues;
|
||||||
|
//chkWrap.Checked = S.ettingWrap;
|
||||||
|
//txtMaxOcc.Text = S.ettingMaxOcc;
|
||||||
|
//txtPrefix.Text = S.ettingPrefix;
|
||||||
|
//txtExpPrefix.Text = S.ettingExpPrefix;
|
||||||
|
//btnTestThings.Visible = S.ettingSpecials;
|
||||||
|
//chkBackupVars.Checked = S.ettingUserCodeBcup;
|
||||||
|
|
||||||
|
|
||||||
|
eventRun = false;
|
||||||
|
runXMLgen();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setLocalValues()
|
||||||
|
{
|
||||||
|
eventRun = true;
|
||||||
chkAnaTag.Checked = S.ettingAnaTag;
|
chkAnaTag.Checked = S.ettingAnaTag;
|
||||||
chkCountVars.Checked = S.ettingCountVars;
|
chkCountVars.Checked = S.ettingCountVars;
|
||||||
chkDisplays.Checked = true;
|
chkDisplays.Checked = true;
|
||||||
@ -1251,10 +1376,7 @@ namespace CobXmlSupport
|
|||||||
txtExpPrefix.Text = S.ettingExpPrefix;
|
txtExpPrefix.Text = S.ettingExpPrefix;
|
||||||
btnTestThings.Visible = S.ettingSpecials;
|
btnTestThings.Visible = S.ettingSpecials;
|
||||||
chkBackupVars.Checked = S.ettingUserCodeBcup;
|
chkBackupVars.Checked = S.ettingUserCodeBcup;
|
||||||
|
|
||||||
|
|
||||||
eventRun = false;
|
eventRun = false;
|
||||||
runXMLgen();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2166,5 +2288,16 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void txtPrefix_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
S.ettingPrefix = txtPrefix.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtExpPrefix_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
S.ettingExpPrefix = txtExpPrefix.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace CobXmlSupport
|
namespace CobXmlSupport
|
||||||
{
|
{
|
||||||
public class GenSetting
|
public class GenSetting:ICloneable
|
||||||
{
|
{
|
||||||
public event SaveHandler evSave;
|
public event SaveHandler evSave;
|
||||||
public EventArgs e = null;
|
public EventArgs e = null;
|
||||||
@ -88,5 +88,13 @@ namespace CobXmlSupport
|
|||||||
S.ettingUserCodeBcup = this.UserCodeBcup;
|
S.ettingUserCodeBcup = this.UserCodeBcup;
|
||||||
S.ettingBackupOwnCode = this.BcupOwnCode;
|
S.ettingBackupOwnCode = this.BcupOwnCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public object Clone()
|
||||||
|
{
|
||||||
|
GenSetting tmpGenSetting = new GenSetting();
|
||||||
|
tmpGenSetting = (GenSetting)this.MemberwiseClone();
|
||||||
|
return tmpGenSetting;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,10 +28,10 @@ namespace CobXmlSupport
|
|||||||
public static bool ettingUserCodeBcup;
|
public static bool ettingUserCodeBcup;
|
||||||
//-------------------------
|
//-------------------------
|
||||||
// public static bool ettingShowTestbtns;
|
// public static bool ettingShowTestbtns;
|
||||||
|
//-------------------------
|
||||||
public static bool ettingBackupOwnCode;
|
public static bool ettingBackupOwnCode;
|
||||||
public static string ettingActualFile;
|
public static string ettingActualFile;
|
||||||
public static string ettingFilePath;
|
public static string ettingFilePath;
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,13 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
private void SaveMethod(GenSetting G, EventArgs e)
|
private void SaveMethod(GenSetting G, EventArgs e)
|
||||||
{
|
{
|
||||||
dict.Add(G.ActualFile, G);
|
GenSetting tmpGS = (GenSetting)G.Clone();
|
||||||
|
GenSetting tmpSett;
|
||||||
|
if (dict.TryGetValue(tmpGS.ActualFile, out tmpSett))
|
||||||
|
{
|
||||||
|
dict[tmpGS.ActualFile] = tmpGS;
|
||||||
|
}
|
||||||
|
else dict.Add(tmpGS.ActualFile, tmpGS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -308,6 +308,9 @@ namespace CobXmlSupport
|
|||||||
S.ettingBackupOwnCode = Properties.Settings.Default.BackupOwnCode = chkBackupOwnCode.Checked;
|
S.ettingBackupOwnCode = Properties.Settings.Default.BackupOwnCode = chkBackupOwnCode.Checked;
|
||||||
S.ettingLogVarName = Properties.Settings.Default.LogVarName = txtLogPost.Text;
|
S.ettingLogVarName = Properties.Settings.Default.LogVarName = txtLogPost.Text;
|
||||||
S.ettingLogSectName = Properties.Settings.Default.LogSectName = txtLogSection.Text;
|
S.ettingLogSectName = Properties.Settings.Default.LogSectName = txtLogSection.Text;
|
||||||
|
S.ettingUserName = Properties.Settings.Default.UserName = txtUserName.Text;
|
||||||
|
S.ettingCompany = Properties.Settings.Default.CompanyName = txtCompanyName.Text;
|
||||||
|
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
|
|
||||||
this.genSet.GetSettings();
|
this.genSet.GetSettings();
|
||||||
@ -318,45 +321,48 @@ namespace CobXmlSupport
|
|||||||
|
|
||||||
private void frmSettings_Load(object sender, EventArgs e)
|
private void frmSettings_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
UserTmp = txtUserName.Text;
|
this.AktualFile = S.ettingActualFile;
|
||||||
CompanyTmp = txtCompanyName.Text;
|
this.FilePath = S.ettingFilePath;
|
||||||
tmpChkNoNsRef = chkNoNsRef.Checked;
|
tmpChkAnaTag = chkAnaTag.Checked = S.ettingAnaTag;
|
||||||
tmpChkUniqueVars = chkUniqueVars.Checked;
|
tmpChkCountVars = chkCountVars.Checked = S.ettingCountVars;
|
||||||
tmpChkUniqueAttrVars = chkUniqueAttrVars.Checked;
|
tmpTxtMaxOcc = txtMaxOcc.Text = S.ettingMaxOcc;
|
||||||
tmpChkUnique = chkUnique.Checked;
|
tmpChkNoNsRef = chkNoNsRef.Checked = S.ettingNoNsRef;
|
||||||
tmpChkWrap = chkWrap.Checked;
|
tmpTxtPrefix = txtPrefix.Text = S.ettingPrefix;
|
||||||
tmpChkValues = chkValues.Checked;
|
tmpTxtExpPrefix = txtExpPrefix.Text = S.ettingExpPrefix;
|
||||||
tmpChkAnaTag = chkAnaTag.Checked;
|
tmpChkUnique = chkUnique.Checked = S.ettingUnique;
|
||||||
tmpShowTestBtns = chkShowTestbtns.Checked;
|
tmpChkUniqueAttrVars = chkUniqueAttrVars.Checked = S.ettingUniqueAttrVars;
|
||||||
tmpBackupOwnCode = chkBackupOwnCode.Checked;
|
tmpChkUniqueVars = chkUniqueVars.Checked = S.ettingUniqueVars;
|
||||||
tmpTxtPrefix = txtPrefix.Text;
|
tmpChkValues = chkValues.Checked = S.ettingValues;
|
||||||
tmpTxtExpPrefix = txtExpPrefix.Text;
|
tmpChkWrap = chkWrap.Checked = S.ettingWrap;
|
||||||
tmpTxtMaxOcc = txtMaxOcc.Text;
|
tmpShowTestBtns = chkShowTestbtns.Checked = S.ettingSpecials;
|
||||||
txtLogVarNameTmp = txtLogPost.Text ;
|
tmpBackupOwnCode = chkBackupOwnCode.Checked = S.ettingBackupOwnCode;
|
||||||
txtLogVarSectTmp = txtLogSection.Text;
|
txtLogVarNameTmp = txtLogPost.Text = S.ettingLogVarName;
|
||||||
|
txtLogVarSectTmp = txtLogSection.Text = S.ettingLogSectName;
|
||||||
|
|
||||||
tmpChkCountVars = chkCountVars.Checked;
|
UserTmp = txtUserName.Text = S.ettingUserName;
|
||||||
|
CompanyTmp = txtCompanyName.Text = S.ettingCompany;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCancel_Click(object sender, EventArgs e)
|
private void btnCancel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
txtUserName.Text = UserTmp;
|
|
||||||
txtCompanyName.Text = CompanyTmp;
|
|
||||||
chkNoNsRef.Checked= tmpChkNoNsRef;
|
|
||||||
chkUniqueVars.Checked= tmpChkUniqueVars;
|
|
||||||
chkUniqueAttrVars.Checked= tmpChkUniqueAttrVars ;
|
|
||||||
chkUnique.Checked= tmpChkUnique;
|
|
||||||
chkWrap.Checked= tmpChkWrap;
|
|
||||||
chkValues.Checked= tmpChkValues;
|
|
||||||
chkAnaTag.Checked = tmpChkAnaTag;
|
chkAnaTag.Checked = tmpChkAnaTag;
|
||||||
chkShowTestbtns.Checked = tmpShowTestBtns;
|
chkCountVars.Checked = tmpChkCountVars;
|
||||||
chkBackupOwnCode.Checked = tmpBackupOwnCode;
|
txtMaxOcc.Text = tmpTxtMaxOcc;
|
||||||
|
chkNoNsRef.Checked = tmpChkNoNsRef;
|
||||||
txtPrefix.Text = tmpTxtPrefix;
|
txtPrefix.Text = tmpTxtPrefix;
|
||||||
txtExpPrefix.Text = tmpTxtExpPrefix;
|
txtExpPrefix.Text = tmpTxtExpPrefix;
|
||||||
txtMaxOcc.Text = tmpTxtMaxOcc;
|
chkUnique.Checked = tmpChkUnique;
|
||||||
|
chkUniqueAttrVars.Checked = tmpChkUniqueAttrVars;
|
||||||
|
chkUniqueVars.Checked = tmpChkUniqueVars;
|
||||||
|
chkValues.Checked = tmpChkValues;
|
||||||
|
chkWrap.Checked = tmpChkWrap;
|
||||||
|
chkShowTestbtns.Checked = tmpShowTestBtns;
|
||||||
|
chkBackupOwnCode.Checked = tmpBackupOwnCode;
|
||||||
txtLogPost.Text = txtLogVarNameTmp;
|
txtLogPost.Text = txtLogVarNameTmp;
|
||||||
txtLogSection.Text = txtLogVarSectTmp;
|
txtLogSection.Text = txtLogVarSectTmp;
|
||||||
chkCountVars.Checked = tmpChkCountVars;
|
|
||||||
|
txtUserName.Text = UserTmp;
|
||||||
|
txtCompanyName.Text = CompanyTmp;
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user