qol: simplify calls

This commit is contained in:
Gary Sharp
2025-07-20 15:20:22 +10:00
parent 1add4ee0f5
commit 9656c15c4b
61 changed files with 214 additions and 214 deletions
@@ -22,11 +22,11 @@ namespace Disco.Data.Configuration
private static ConfigurationCacheType Cache(DiscoDataContext Database)
{
if (ConfigurationCache.cacheStore == null)
if (cacheStore == null)
{
lock (configChangeLock)
{
if (ConfigurationCache.cacheStore == null)
if (cacheStore == null)
{
if (Database == null)
throw new InvalidOperationException("The Configuration must be loaded at least once before a Cache-Only Configuration Context is used");
@@ -46,7 +46,7 @@ namespace Disco.Data.Configuration
}
}
return ConfigurationCache.cacheStore;
return cacheStore;
}
private static ConfigurationCacheItemType CacheGetItem(DiscoDataContext Database, string Scope, string Key)
@@ -160,7 +160,7 @@ namespace Disco.Data.Configuration
}
private static ConfigurationCacheItemType SetItemTypeValue(ConfigurationCacheItemType ExistingItem, object Value)
{
var cache = ConfigurationCache.cacheStore;
var cache = cacheStore;
if (cache.TryGetValue(ExistingItem.Item1.Scope, out var scopeCache))
{
@@ -113,7 +113,7 @@ namespace Disco.Data.Configuration
{
get
{
return System.IO.Path.Combine(DataStoreLocation, "OrganisationLogo.png");
return Path.Combine(DataStoreLocation, "OrganisationLogo.png");
}
}
public string OrganisationLogoHash
@@ -135,15 +135,15 @@ namespace Disco.Data.Configuration
if (File.Exists(path))
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
else
return new MemoryStream(Disco.Data.Properties.Resources.EmptyLogo);
return new MemoryStream(Properties.Resources.EmptyLogo);
}
set
{
string organisationLogoPath = OrganisationLogoPath;
if (value == null)
{
if (System.IO.File.Exists(organisationLogoPath))
System.IO.File.Delete(organisationLogoPath);
if (File.Exists(organisationLogoPath))
File.Delete(organisationLogoPath);
}
else
{