using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HotelPms.Share.Windows.Component
{
///
/// コントロールのプロパティの拡張
/// GC.Collect();の直後、ConditionalWeakTableより自動で消える
///
public class ControlPropertyEx
{
public static ConditionalWeakTable Data { get; set; } = new ConditionalWeakTable();
///
/// 追加プロパティ
///
public Dictionary Addition { get; set; } = new Dictionary();
public override string ToString()
{
StringBuilder text = new StringBuilder();
foreach(KeyValuePair item in Addition)
{
text.Append($"{item.Key}={item.Value};");
}
return text.ToString();
}
}
}