Added In JsonToSimplFileMaster and JsonToSimplPortalFileMaster - Made 'ActualFilePath' a public property, created a new event type (JsonActualFileChange) and raise the event whenever ActualFilePath is determined

This commit is contained in:
Trevor Payne
2019-09-20 00:13:47 -05:00
parent 1747372ce3
commit ef81d38fc2
3 changed files with 12 additions and 8 deletions

View File

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

View File

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

View File

@@ -17,9 +17,9 @@ namespace PepperDash.Core.JsonToSimpl
/// <summary> /// <summary>
/// Sets the filepath as well as registers this with the Global.Masters list /// Sets the filepath as well as registers this with the Global.Masters list
/// </summary> /// </summary>
public string PortalFilepath { get; private set; } public string PortalFilepath { get; private set; }
string ActualFilePath; public string ActualFilePath { get; private set; }
/*****************************************************************************************/ /*****************************************************************************************/
/** Privates **/ /** Privates **/
@@ -61,7 +61,8 @@ namespace PepperDash.Core.JsonToSimpl
if (actualLocalFile != null) if (actualLocalFile != null)
{ {
ActualFilePath = actualLocalFile.FullName; ActualFilePath = actualLocalFile.FullName;
OnStringChange(ActualFilePath, 0, JsonToSimplConstants.JsonActualFileChange);
} }
// If the local file does not exist, then read the portal file xyz.json // If the local file does not exist, then read the portal file xyz.json
// and create the local. // and create the local.