|
|
|
@ -2,6 +2,8 @@ |
|
|
|
// Created: 2020-02-12 |
|
|
|
// Created: 2020-02-12 |
|
|
|
// Copyright(c) 2020 SimonG. All Rights Reserved. |
|
|
|
// Copyright(c) 2020 SimonG. All Rights Reserved. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using GBase.DataHandling.Factories; |
|
|
|
using GBase.DataHandling.Factories; |
|
|
|
@ -46,6 +48,56 @@ namespace GBase.FileHandling |
|
|
|
return success; |
|
|
|
return success; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// Set the value for the given property |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <typeparam name="T">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <typeparam name="TProperty">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <param name="propertyName">The name of the property</param> |
|
|
|
|
|
|
|
/// <param name="value">The value to set</param> |
|
|
|
|
|
|
|
/// <returns>A <see cref="Task"/> to await</returns> |
|
|
|
|
|
|
|
public async Task SetValue<T, TProperty>(string propertyName, TProperty value) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await DataHandler.SetValue<T, TProperty>(propertyName, value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// Remove the value for the given property |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <typeparam name="T">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <typeparam name="TProperty">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <param name="propertyName">The name of the property</param> |
|
|
|
|
|
|
|
/// <param name="value">The value to set</param> |
|
|
|
|
|
|
|
/// <returns>A <see cref="Task"/> to await</returns> |
|
|
|
|
|
|
|
public async Task RemoveValue<T, TProperty>(string propertyName, TProperty value) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await DataHandler.RemoveValue<T, TProperty>(propertyName, value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// Get the value for the given property, if multiple values are set the first is returned |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <typeparam name="T">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <typeparam name="TProperty">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <param name="propertyName">The name of the property</param> |
|
|
|
|
|
|
|
/// <returns>The value for the given property</returns> |
|
|
|
|
|
|
|
public async Task<TProperty> GetValue<T, TProperty>(string propertyName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return await DataHandler.GetValue<T, TProperty>(propertyName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// Get all the values that are set for the given property |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <typeparam name="T">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <typeparam name="TProperty">The <see cref="Type"/> of the property</typeparam> |
|
|
|
|
|
|
|
/// <param name="propertyName">The name of the property</param> |
|
|
|
|
|
|
|
/// <returns>An <see cref="IEnumerable{T}"/> with all the values for the property</returns> |
|
|
|
|
|
|
|
public async Task<IEnumerable<TProperty>> GetValues<T, TProperty>(string propertyName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return await DataHandler.GetValues<T, TProperty>(propertyName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Dispose used resources asynchronously |
|
|
|
/// Dispose used resources asynchronously |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
|