private bool GetEnabledState() { object isEnabled = DataDealer.ReadMiscData(ENABLED_KEY); bool enabled; if (isEnabled == null) { DataDealer.AppendMiscData(ENABLED_KEY, false); enabled = false; } else { enabled = (bool)isEnabled; } // If it's null, we need to write return(enabled); }
/// <summary> /// Saves the current state of the enabledness of the robot logging system /// </summary> private void SaveEnabledState() { // Append the data to the data dealer. DataDealer.AppendMiscData(ENABLED_KEY, IsEnabled); }