using System;
using System.ComponentModel;

namespace OpenCVStudio_v0
{
    /// <summary>
    /// Свойства блока абсолютного значения.
    /// </summary>
    public sealed class AbsBlockProperties
    {
        private readonly ProjectBlock projectBlock;

        public AbsBlockProperties(ProjectManager projectManager, ProjectBlock projectBlock)
        {
            ArgumentNullException.ThrowIfNull(projectManager);
            this.projectBlock = projectBlock ?? throw new ArgumentNullException(nameof(projectBlock));
        }

        [Category("Информация")]
        [DisplayName("Операция")]
        [ReadOnly(true)]
        public string Operation => "Cv2.Abs";

        [Category("Информация")]
        [DisplayName("Описание")]
        [ReadOnly(true)]
        public string Description => "Вычисляет абсолютное значение пикселей.";

        [Category("Блок")]
        [DisplayName("Название")]
        [ReadOnly(true)]
        public string BlockName => projectBlock.Name ?? string.Empty;

        [Category("Блок")]
        [DisplayName("Тип")]
        [ReadOnly(true)]
        public string BlockType => projectBlock.BlockType ?? string.Empty;

        [Category("Блок")]
        [DisplayName("Позиция")]
        [ReadOnly(true)]
        public int Position => projectBlock.Order + 1;
    }
}