mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-03 14:54:53 +00:00
Fixed failure in Debug.LoadMemory where a null Contexts could be created from an empty file
This commit is contained in:
@@ -34,7 +34,7 @@ namespace PepperDash.Core
|
||||
|
||||
static Debug()
|
||||
{
|
||||
CrestronDataStoreStatic.InitCrestronDataStore();
|
||||
//CrestronDataStoreStatic.InitCrestronDataStore();
|
||||
if (CrestronEnvironment.RuntimeEnvironment == eRuntimeEnvironment.SimplSharpPro)
|
||||
{
|
||||
// Add command to console
|
||||
@@ -49,27 +49,6 @@ namespace PepperDash.Core
|
||||
Level = Contexts.GetOrCreateItem("DEFAULT").Level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This should called from the ControlSystem Initiailize method. Will attempt to call
|
||||
/// CrestronDataStoreStatic.InitCrestronDataStore which may have been called elsewhere.
|
||||
/// </summary>
|
||||
public static void Initialize()
|
||||
{
|
||||
//CrestronDataStoreStatic.InitCrestronDataStore();
|
||||
//if (CrestronEnvironment.RuntimeEnvironment == eRuntimeEnvironment.SimplSharpPro)
|
||||
//{
|
||||
// // Add command to console
|
||||
// CrestronConsole.AddNewConsoleCommand(SetDebugFromConsole, "appdebug",
|
||||
// "appdebug:P [0-2]: Sets the application's console debug message level",
|
||||
// ConsoleAccessLevelEnum.AccessOperator);
|
||||
//}
|
||||
|
||||
//CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
||||
|
||||
//LoadMemory();
|
||||
//Level = Contexts.GetOrCreateItem("DEFAULT").Level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to save memory when shutting down
|
||||
/// </summary>
|
||||
@@ -231,18 +210,28 @@ namespace PepperDash.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
static void LoadMemory()
|
||||
{
|
||||
if (File.Exists(GetMemoryFileName()))
|
||||
var file = GetMemoryFileName();
|
||||
if (File.Exists(file))
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(GetMemoryFileName()))
|
||||
using (StreamReader sr = new StreamReader(file))
|
||||
{
|
||||
var json = sr.ReadToEnd();
|
||||
Contexts = JsonConvert.DeserializeObject<DebugContextCollection>(json);
|
||||
|
||||
if (Contexts != null)
|
||||
{
|
||||
Debug.Console(0, "Debug memory restored from file");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
Contexts = new DebugContextCollection();
|
||||
|
||||
Contexts = new DebugContextCollection();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -10,8 +10,8 @@
|
||||
<ArchiveName />
|
||||
</RequiredInfo>
|
||||
<OptionalInfo>
|
||||
<CompiledOn>12/6/2016 4:09:28 PM</CompiledOn>
|
||||
<CompilerRev>1.0.0.29083</CompilerRev>
|
||||
<CompiledOn>12/7/2016 11:49:31 AM</CompiledOn>
|
||||
<CompilerRev>1.0.0.21285</CompilerRev>
|
||||
</OptionalInfo>
|
||||
<Plugin>
|
||||
<Version>Crestron.SIMPLSharp, Version=2.0.48.0, Culture=neutral, PublicKeyToken=812d080f93e2de10</Version>
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
MainAssembly=PepperDash_Core.dll:987a92dfd5c1b46ff22b2570acef6436
|
||||
MainAssembly=PepperDash_Core.dll:b01629320e6c37f54b704d6f0e45c085
|
||||
MainAssemblyMinFirmwareVersion=1.007.0017
|
||||
MainAssemblyResource=SimplSharpData.dat:315526abf906cded47fb0c7510266a7e
|
||||
ü
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,10 @@
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.pdb
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpCustomAttributesInterface.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpHelperInterface.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.pdb
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpNewtonsoft.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpSQLHelperInterface.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\SimplSharpReflectionInterface.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\ResolveAssemblyReference.cache
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.dll
|
||||
C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\obj\Debug\PepperDash_Core.pdb
|
||||
|
||||
Reference in New Issue
Block a user