Exposes DoNotStartOnNextBoot property on the Debug class properly.

This commit is contained in:
Neil Dorin
2019-11-15 13:06:37 -07:00
parent acf9514fc5
commit 7fdbf7c3a1
2 changed files with 18 additions and 10 deletions

View File

@@ -28,6 +28,8 @@ namespace PepperDash.Core
public static int Level { get; private set; }
public static bool DoNotStartOnNextBoot { get; private set; }
static DebugContextCollection Contexts;
static int SaveTimeoutMs = 30000;
@@ -81,7 +83,10 @@ namespace PepperDash.Core
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
LoadMemory();
Level = Contexts.GetOrCreateItem("DEFAULT").Level;
var context = Contexts.GetOrCreateItem("DEFAULT");
Level = context.Level;
DoNotStartOnNextBoot = context.DoNotStartOnNextBoot;
try
{
@@ -243,10 +248,12 @@ namespace PepperDash.Core
/// <param name="state"></param>
public static void SetDoNotStartOnNextBoot(bool state)
{
Contexts.DoNotStartOnNextBoot = state;
CrestronConsole.PrintLine("[Application {0}], Do Not Start on Next Boot set to {1}",
InitialParametersClass.ApplicationNumber, Contexts.DoNotStartOnNextBoot);
DoNotStartOnNextBoot = state;
Contexts.GetOrCreateItem("DEFAULT").DoNotStartOnNextBoot = state;
SaveMemoryOnTimeout();
CrestronConsole.PrintLine("[Application {0}], Do Not Start on Next Boot set to {1}",
InitialParametersClass.ApplicationNumber, DoNotStartOnNextBoot);
}
/// <summary>

View File

@@ -10,12 +10,6 @@ namespace PepperDash.Core.DebugThings
{
public class DebugContextCollection
{
/// <summary>
/// Property to tell the program not to intitialize when it boots, if desired
/// </summary>
[JsonProperty("doNotStartOnNextBoot")]
public bool DoNotStartOnNextBoot { get; set; }
[JsonProperty("items")]
Dictionary<string, DebugContextItem> Items;
@@ -59,6 +53,13 @@ namespace PepperDash.Core.DebugThings
[JsonProperty("level")]
public int Level { get; set; }
/// <summary>
/// Property to tell the program not to intitialize when it boots, if desired
/// </summary>
[JsonProperty("doNotStartOnNextBoot")]
public bool DoNotStartOnNextBoot { get; set; }
public DebugContextItem(DebugContextCollection parent)
{