added uninstall support for modules

This commit is contained in:
Shaun Walker
2020-04-12 20:08:19 -04:00
parent 112397c9de
commit 482747627e
12 changed files with 121 additions and 100 deletions

View File

@ -9,7 +9,24 @@ namespace Oqtane.Repository
{
public class ThemeRepository : IThemeRepository
{
private List<Theme> _themes; // lazy load
public IEnumerable<Theme> GetThemes()
{
return LoadThemes();
}
private List<Theme> LoadThemes()
{
if (_themes == null)
{
// get themes
_themes = LoadThemesFromAssemblies();
}
return _themes;
}
private List<Theme> LoadThemesFromAssemblies()
{
List<Theme> themes = new List<Theme>();
@ -103,20 +120,5 @@ namespace Oqtane.Repository
}
return themes;
}
private string GetProperty(Dictionary<string, string> properties, string key)
{
string value = "";
if (properties.ContainsKey(key))
{
value = properties[key];
}
return value;
}
public IEnumerable<Theme> GetThemes()
{
return LoadThemes();
}
}
}