Separate codecompl dep on fieldprefix

This commit is contained in:
2015-03-31 16:50:15 +02:00
parent 369a7a638e
commit 5b90d12efd
3 changed files with 42 additions and 13 deletions

View File

@ -11,6 +11,7 @@ namespace CobXmlSupport
{
private Dictionary<string, string> __wrkDicIn = null;
private Dictionary<string, string> __wrkDicOut = null;
private string __FieldPrefix;
private string __filePathId;
private string __fileId;
private string __pathId;
@ -22,6 +23,7 @@ namespace CobXmlSupport
public codeCompleter()
{
__FieldPrefix = "";
__filePathId = "";
__fileId = "";
__pathId = "";
@ -31,8 +33,9 @@ namespace CobXmlSupport
__ccFileOutIdNoSuff = "";
}
public codeCompleter(string pathFileId)
public codeCompleter(string pathFileId,string fpref)
{
__FieldPrefix = fpref;
__filePathId = pathFileId;
nameCreator(__filePathId);
__wrkDicIn = new Dictionary<string, string>();
@ -81,12 +84,13 @@ namespace CobXmlSupport
private void nameCreator(string inPathFname)
{
string gPrefix = "." + __FieldPrefix.Replace("_", "").Trim();
__fileId = inPathFname.Substring(inPathFname.LastIndexOf("\\") + 1);
__pathId = inPathFname.Substring(0, inPathFname.LastIndexOf("\\") + 1);
__ccFileInId = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".In" + JSON;
__ccFileOutId = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".Out" + JSON;
__ccFileInIdNoSuff = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".In";
__ccFileOutIdNoSuff = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".Out";
__ccFileInId = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".In" + gPrefix + JSON;
__ccFileOutId = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".Out" + gPrefix + JSON;
__ccFileInIdNoSuff = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".In" + gPrefix;
__ccFileOutIdNoSuff = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".Out" + gPrefix;
}
private string backupSuffix()
@ -149,7 +153,12 @@ namespace CobXmlSupport
public void Save_In_Dic()
{
string ccFileInId = __pathId + __ccFileInId;
string ccFileInBackup = __pathId + __ccFileInIdNoSuff + backupSuffix();
if (Directory.Exists(__pathId + @"\JsonBackup\")) { }
else
{
Directory.CreateDirectory(__pathId + @"\JsonBackup\");
}
string ccFileInBackup = __pathId +@"\JsonBackup\"+ __ccFileInIdNoSuff + backupSuffix();
if (__filePathId.Trim() == "") { }
else
@ -169,7 +178,12 @@ namespace CobXmlSupport
public void Save_Out_Dic()
{
string ccFileOutId = __pathId + __ccFileOutId;
string ccFileOutBackup = __pathId + __ccFileOutIdNoSuff + backupSuffix();
if (Directory.Exists(__pathId + @"\JsonBackup\")) { }
else
{
Directory.CreateDirectory(__pathId + @"\JsonBackup\");
}
string ccFileOutBackup = __pathId + @"\JsonBackup\" + __ccFileOutIdNoSuff + backupSuffix();
if (__filePathId.Trim() == "") { }
else