Rename UserData to Attribute.
This commit is contained in:
parent
9b6a15c6ec
commit
ff3b3ee961
@ -9,7 +9,7 @@ namespace Dashboard.Controls
|
||||
/// <summary>
|
||||
/// Bases for all UI elements.
|
||||
/// </summary>
|
||||
public abstract class UIBase : IDbUserdata
|
||||
public abstract class UIBase : IDbAttribute
|
||||
{
|
||||
private Vector2 size;
|
||||
|
||||
@ -60,7 +60,7 @@ namespace Dashboard.Controls
|
||||
public bool IsMaximumSizeSet => MaximumSize != new Vector2(-1, -1);
|
||||
public bool IsMinimumSizeSet => MinimumSize != new Vector2(-1, -1);
|
||||
|
||||
public Dictionary<string, object> Userdata { get; } = new Dictionary<string, object>();
|
||||
public Dictionary<string, object> Attributes { get; } = new Dictionary<string, object>();
|
||||
|
||||
public virtual void NotifyEvent(object? sender, EventArgs args)
|
||||
{
|
||||
@ -95,7 +95,7 @@ namespace Dashboard.Controls
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
foreach (object userdata in Userdata.Values)
|
||||
foreach (object userdata in Attributes.Values)
|
||||
{
|
||||
if (userdata is IDisposable disposable)
|
||||
disposable.Dispose();
|
||||
|
@ -5,17 +5,17 @@ using System.Collections.Generic;
|
||||
namespace Dashboard
|
||||
{
|
||||
/// <summary>
|
||||
/// Common interface for Dashboard objects that accept userdata.
|
||||
/// Common interface for Dashboard objects that accept attributes.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Dashboard will call dispose on any and all objects which implement IDisposable.
|
||||
/// If this is an issue, please guard your object against this using a wrapper.
|
||||
/// </remarks
|
||||
public interface IDbUserdata : IDisposable
|
||||
public interface IDbAttribute : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Userdata dictionary.
|
||||
/// Attribute dictionary.
|
||||
/// </summary>
|
||||
public Dictionary<string, object> Userdata { get; }
|
||||
public Dictionary<string, object> Attributes { get; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user