using System;

namespace Decal.Adapter;

/// <summary>
/// ControlEvent AutoWireup
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class ControlEventAttribute : ViewBaseAttribute
{
	private string myControl;

	private string myEventName;

	/// <summary>
	/// Control Name
	/// </summary>
	public string Control => myControl;

	/// <summary>
	/// Event to Wire
	/// </summary>
	public string EventName => myEventName;

	/// <summary>
	/// Constructs the ControlEvent
	/// </summary>
	/// <param name="control">Control Name</param>
	/// <param name="controlEvent">Event to Wire</param>
	public ControlEventAttribute(string control, string eventName)
	{
		myControl = control;
		myEventName = eventName;
	}
}
