protected virtual void ApplyDisplayConfigUpdate(DisplayConfig target, params DisplayConfigJson.JsonConfigParameterUpdatePermission[] permissions) { if (DisplayConfigJson.JsonFileExists()) { DisplayConfigJson.JsonConfig updater = new DisplayConfigJson.JsonConfig(DisplayConfigJson.JsonPath); updater.UpdatePermittedAttributesOn(_displayConfig, permissions); } }
/// <summary> /// Defines a method for any LeiaDevice to update its _displayConfig with sparsely defined data from json on the device /// </summary> /// <param name="permissions">Permission level(s)</param> protected virtual void ApplyDisplayConfigUpdate(params DisplayConfigJson.JsonConfigParameterUpdatePermission[] permissions) { if (_displayConfig == null) { LogUtil.Log(LogLevel.Error, "Called ApplyDisplayConfigUpdate but AbstractLeiaDevice :: _displayConfig is null"); // Catch case of uninitialized DisplayConfig; throw error, but do not return. Need to run in broad span of cases to see fail cases _displayConfig = new DisplayConfig(); } if (DisplayConfigJson.JsonFileExists()) { DisplayConfigJson.JsonConfig updater = new DisplayConfigJson.JsonConfig(DisplayConfigJson.JsonPath); updater.UpdatePermittedAttributesOn(_displayConfig, permissions); } }