Merged in feature/JsonFilePathOut (pull request #26)

Add new feature - JsonFilenameOut
This commit is contained in:
Trevor Payne
2019-09-20 15:01:18 +00:00
committed by Heath Volmer
3 changed files with 14 additions and 9 deletions

View File

@@ -11,12 +11,14 @@ namespace PepperDash.Core.JsonToSimpl
/// </summary>
public class JsonToSimplConstants
{
public const ushort JsonIsValidBoolChange = 2;
public const ushort JsonIsValidBoolChange = 2;
public const ushort BoolValueChange = 1;
public const ushort UshortValueChange = 101;
public const ushort StringValueChange = 201;
public const ushort FullPathToArrayChange = 202;
public const ushort FullPathToArrayChange = 202;
public const ushort ActualFilePathChange = 203;
}
//**************************************************************************************************//

View File

@@ -17,7 +17,7 @@ namespace PepperDash.Core.JsonToSimpl
/// </summary>
public string Filepath { get; private set; }
string ActualFilePath;
public string ActualFilePath { get; private set; }
/*****************************************************************************************/
/** Privates **/
@@ -67,7 +67,8 @@ namespace PepperDash.Core.JsonToSimpl
return;
}
//var actualFileName = actualFile.FullName;
ActualFilePath = actualFile.FullName;
ActualFilePath = actualFile.FullName;
OnStringChange(ActualFilePath, 0, JsonToSimplConstants.ActualFilePathChange);
Debug.Console(1, "Actual JSON file is {0}", ActualFilePath);
string json = File.ReadToEnd(ActualFilePath, System.Text.Encoding.ASCII);

View File

@@ -17,9 +17,9 @@ namespace PepperDash.Core.JsonToSimpl
/// <summary>
/// Sets the filepath as well as registers this with the Global.Masters list
/// </summary>
public string PortalFilepath { get; private set; }
string ActualFilePath;
public string PortalFilepath { get; private set; }
public string ActualFilePath { get; private set; }
/*****************************************************************************************/
/** Privates **/
@@ -61,7 +61,8 @@ namespace PepperDash.Core.JsonToSimpl
if (actualLocalFile != null)
{
ActualFilePath = actualLocalFile.FullName;
ActualFilePath = actualLocalFile.FullName;
OnStringChange(ActualFilePath, 0, JsonToSimplConstants.ActualFilePathChange);
}
// If the local file does not exist, then read the portal file xyz.json
// and create the local.
@@ -74,7 +75,8 @@ namespace PepperDash.Core.JsonToSimpl
var newLocalPath = Path.ChangeExtension(actualPortalFile.FullName, "local.json");
// got the portal file, hand off to the merge / save method
PortalConfigReader.ReadAndMergeFileIfNecessary(actualPortalFile.FullName, newLocalPath);
ActualFilePath = newLocalPath;
ActualFilePath = newLocalPath;
OnStringChange(ActualFilePath, 0, JsonToSimplConstants.ActualFilePathChange);
}
else
{