applying new struckture and working vlc
This commit is contained in:
@@ -37,14 +37,14 @@ public class Jason_Writer
|
||||
|
||||
|
||||
// Load one list of locJason objects from JSON file with given name
|
||||
public List<locJason> LoadList(string listName)
|
||||
public async Task<List<locJason>> LoadListAsync(string listName)
|
||||
{
|
||||
string filePath = Path.Combine(_folderPath, $"{listName}.json");
|
||||
|
||||
if (!File.Exists(filePath))
|
||||
return new List<locJason>(); // Return empty list if file doesn't exist
|
||||
return new List<locJason>();
|
||||
|
||||
string jsonString = File.ReadAllText(filePath);
|
||||
string jsonString = await File.ReadAllTextAsync(filePath);
|
||||
return JsonConvert.DeserializeObject<List<locJason>>(jsonString) ?? new List<locJason>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user