From b2e98ff8dcc7754fc03f3bba43e277200f2b5972 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 20 Oct 2010 16:49:42 +0000 Subject: [PATCH] --- PROMS/Volian.Base.Library/VlnSettings.cs | 42 ++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Base.Library/VlnSettings.cs b/PROMS/Volian.Base.Library/VlnSettings.cs index c6048829..f1a5a2ee 100644 --- a/PROMS/Volian.Base.Library/VlnSettings.cs +++ b/PROMS/Volian.Base.Library/VlnSettings.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Text; using System.IO; +using System.Configuration; namespace Volian.Base.Library { @@ -15,13 +16,48 @@ namespace Volian.Base.Library // // For DataLoader, this is set via the Debug checkbox on the form. - private static bool _DebugMode = true; - + private static bool WasLoaded = false; + private static bool _DebugMode = false; public static bool DebugMode { - get { return _DebugMode; } + get + { + if (!WasLoaded) LoadOperatingMode(); + return _DebugMode; + } set { _DebugMode = value; } } + private static bool _DemoMode = false; + public static bool DemoMode + { + get + { + if (!WasLoaded) LoadOperatingMode(); + return _DemoMode; + } + set { _DemoMode = value; } + } + private static bool _ProductionMode = true; // default to OperatingMode to production + public static bool ProductionMode + { + get + { + if (!WasLoaded) LoadOperatingMode(); + return _ProductionMode; + } + set { _ProductionMode = value; } + } + private static void LoadOperatingMode() + { + string opMode = ConfigurationManager.AppSettings["OperatingMode"]; + if (opMode != null && opMode != "") + { + _DebugMode = opMode.ToUpper() == "DEBUG"; + _DemoMode = opMode.ToUpper() == "DEMO"; + _ProductionMode = opMode.ToUpper() == "PRODUCTION"; + } + WasLoaded = true; + } private static string _TemporaryFolder = null; public static string TemporaryFolder {