feat(Permission) Added start of the Storage feature. Detailed/Plain default toggle

This commit is contained in:
2022-04-24 19:33:18 -04:00
parent 8a4d00054a
commit afaafbe713
20 changed files with 538 additions and 65 deletions
+21 -5
View File
@@ -1,12 +1,28 @@
namespace Services.Immortal;
using Services.Website;
namespace Services.Immortal;
public class EntityViewType
{
public static string Detailed = "Detailed";
public static string Plain = "Plain";
}
public class EntityDisplayService : IEntityDisplayService
{
private string displayType = "Detailed";
private string _displayType;
public EntityDisplayService(IStorageService storageService)
{
_displayType = storageService.GetValue<bool>(StorageKeys.IsPlainView)
? EntityViewType.Plain : EntityViewType.Detailed;
}
public List<string> DefaultChoices()
{
return new List<string> { "Detailed", "Plain" };
return new List<string> { EntityViewType.Detailed, EntityViewType.Plain };
}
public void Subscribe(Action action)
@@ -21,12 +37,12 @@ public class EntityDisplayService : IEntityDisplayService
public string GetDisplayType()
{
return displayType;
return _displayType;
}
public void SetDisplayType(string displayType)
{
this.displayType = displayType;
this._displayType = displayType;
NotifyDataChanged();
}