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