Client fixes

Client is partially done.
227 warnings left out of 1500
I like Rider
This commit is contained in:
Pavel Vesely
2020-03-15 15:18:32 +01:00
parent 5b3feaf26f
commit cf6643aef3
92 changed files with 1283 additions and 1262 deletions

View File

@ -23,14 +23,14 @@ namespace Oqtane.Services
_navigationManager = navigationManager;
}
private string apiurl
private string Apiurl
{
get { return CreateApiUrl(_siteState.Alias, _navigationManager.Uri, "Theme"); }
}
public async Task<List<Theme>> GetThemesAsync()
{
List<Theme> themes = await _http.GetJsonAsync<List<Theme>>(apiurl);
List<Theme> themes = await _http.GetJsonAsync<List<Theme>>(Apiurl);
// get list of loaded assemblies
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
@ -45,7 +45,7 @@ namespace Oqtane.Services
if (assemblies.Where(item => item.FullName.StartsWith(assemblyname + ",")).FirstOrDefault() == null)
{
// download assembly from server and load
var bytes = await _http.GetByteArrayAsync(apiurl + "/load/" + assemblyname + ".dll");
var bytes = await _http.GetByteArrayAsync(Apiurl + "/load/" + assemblyname + ".dll");
Assembly.Load(bytes);
}
}
@ -53,7 +53,7 @@ namespace Oqtane.Services
if (assemblies.Where(item => item.FullName.StartsWith(theme.AssemblyName + ",")).FirstOrDefault() == null)
{
// download assembly from server and load
var bytes = await _http.GetByteArrayAsync(apiurl + "/load/" + theme.AssemblyName + ".dll");
var bytes = await _http.GetByteArrayAsync(Apiurl + "/load/" + theme.AssemblyName + ".dll");
Assembly.Load(bytes);
}
}
@ -61,10 +61,10 @@ namespace Oqtane.Services
return themes.OrderBy(item => item.Name).ToList();
}
public Dictionary<string, string> GetThemeTypes(List<Theme> Themes)
public Dictionary<string, string> GetThemeTypes(List<Theme> themes)
{
var selectableThemes = new Dictionary<string, string>();
foreach (Theme theme in Themes)
foreach (Theme theme in themes)
{
foreach (string themecontrol in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
@ -74,12 +74,12 @@ namespace Oqtane.Services
return selectableThemes;
}
public Dictionary<string, string> GetPaneLayoutTypes(List<Theme> Themes, string ThemeName)
public Dictionary<string, string> GetPaneLayoutTypes(List<Theme> themes, string themeName)
{
var selectablePaneLayouts = new Dictionary<string, string>();
foreach (Theme theme in Themes)
foreach (Theme theme in themes)
{
if (ThemeName.StartsWith(theme.ThemeName))
if (themeName.StartsWith(theme.ThemeName))
{
foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
@ -90,10 +90,10 @@ namespace Oqtane.Services
return selectablePaneLayouts;
}
public Dictionary<string, string> GetContainerTypes(List<Theme> Themes)
public Dictionary<string, string> GetContainerTypes(List<Theme> themes)
{
var selectableContainers = new Dictionary<string, string>();
foreach (Theme theme in Themes)
foreach (Theme theme in themes)
{
foreach (string container in theme.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
@ -105,12 +105,12 @@ namespace Oqtane.Services
public async Task InstallThemesAsync()
{
await _http.GetJsonAsync<List<string>>(apiurl + "/install");
await _http.GetJsonAsync<List<string>>(Apiurl + "/install");
}
public async Task DeleteThemeAsync(string ThemeName)
public async Task DeleteThemeAsync(string themeName)
{
await _http.DeleteAsync(apiurl + "/" + ThemeName);
await _http.DeleteAsync(Apiurl + "/" + themeName);
}
}
}