// Copyright © Selmo Technology GmbH. All Rights Reserved

using SelmoStudio.Hmi.Server.SelmoHmi.Shared.Component.Ids;
using SelmoStudio.Hmi.Server.SelmoHmi.Shared.Component.Types;

namespace SelmoStudio.Hmi.Server.SelmoHmi.Shared.Component.CustomArgs
{
    public class TextBoxEventArgs : EventArgs
    {
        public TextBoxEventArgs(ComponentId id, EventType eventType, string value, HmiElementType type)
        {
            Id = id;
            EventType = eventType;
            Value = value;
            ButtonType = type;
        }

        public ComponentId Id { get; set; }

        public EventType EventType { get; set; }

        public string Value { get; set; }

        public HmiElementType ButtonType { get; set; }

        public ComponentEventInfo ToEventInfo()
        {
            var eventInfo = new ComponentEventInfo()
            {
                ComponentId = Id,
                Type = EventType,
                ButtonType = ButtonType
            };

            return eventInfo;
        }
    }
}