mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 16:52:57 +00:00
Added documentation
This commit is contained in:
parent
695cc4cbbb
commit
7a35626c91
@ -6,6 +6,12 @@ public sealed class SettingsLocker
|
|||||||
{
|
{
|
||||||
private readonly Dictionary<string, Dictionary<string, Guid>> lockedProperties = new();
|
private readonly Dictionary<string, Dictionary<string, Guid>> lockedProperties = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Registers a property of a class to be locked by a specific configuration plugin ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="propertyExpression">The property expression to lock.</param>
|
||||||
|
/// <param name="configurationPluginId">The ID of the configuration plugin that locks the property.</param>
|
||||||
|
/// <typeparam name="T">The type of the class that contains the property.</typeparam>
|
||||||
public void Register<T>(Expression<Func<T, object>> propertyExpression, Guid configurationPluginId)
|
public void Register<T>(Expression<Func<T, object>> propertyExpression, Guid configurationPluginId)
|
||||||
{
|
{
|
||||||
var memberExpression = propertyExpression.GetMemberExpression();
|
var memberExpression = propertyExpression.GetMemberExpression();
|
||||||
@ -18,6 +24,11 @@ public sealed class SettingsLocker
|
|||||||
this.lockedProperties[className].TryAdd(propertyName, configurationPluginId);
|
this.lockedProperties[className].TryAdd(propertyName, configurationPluginId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes the lock for a property of a class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="propertyExpression">The property expression to remove the lock for.</param>
|
||||||
|
/// <typeparam name="T">The type of the class that contains the property.</typeparam>
|
||||||
public void Remove<T>(Expression<Func<T, object>> propertyExpression)
|
public void Remove<T>(Expression<Func<T, object>> propertyExpression)
|
||||||
{
|
{
|
||||||
var memberExpression = propertyExpression.GetMemberExpression();
|
var memberExpression = propertyExpression.GetMemberExpression();
|
||||||
@ -35,6 +46,12 @@ public sealed class SettingsLocker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the configuration plugin ID that locks a specific property of a class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="propertyExpression"></param>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <returns></returns>
|
||||||
public Guid GetConfigurationPluginId<T>(Expression<Func<T, object>> propertyExpression)
|
public Guid GetConfigurationPluginId<T>(Expression<Func<T, object>> propertyExpression)
|
||||||
{
|
{
|
||||||
var memberExpression = propertyExpression.GetMemberExpression();
|
var memberExpression = propertyExpression.GetMemberExpression();
|
||||||
|
Loading…
Reference in New Issue
Block a user