using GatewayTool.UserControls;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GatewayTool.Models
{
    public class SensorDataItemCollection : CollectionBase
    {
        public SensorDataItem this[int index]
        {
            get { return (SensorDataItem)List[index]; }
        }

        public void Add(SensorDataItem item)
        {
            List.Add(item);
        }

        public void Remove(SensorDataItem item)
        {
            List.Remove(item);
        }
    }

    public class SensorDataItemCollectionEditor : CollectionEditorEx
    {
        public SensorDataItemCollectionEditor(Type type) : base(type)
        {
        }

        protected override string GetDisplayText(object value)
        {
            SensorDataItem item = new SensorDataItem();
            item = (SensorDataItem)value;
            return base.GetDisplayText($"SensorDataItem");
        }
    }

    public class CommandDataItemCollection : CollectionBase
    {
        public CommandDataItem this[int index]
        {
            get { return (CommandDataItem)List[index]; }
        }

        public void Add(CommandDataItem item)
        {
            List.Add(item);
        }

        public void Remove(CommandDataItem item)
        {
            List.Remove(item);
        }
    }

    public class CommandDataItemCollectionEditor : CollectionEditorEx
    {
        public CommandDataItemCollectionEditor(Type type) : base(type)
        {
        }

        protected override string GetDisplayText(object value)
        {
            CommandDataItem item = new CommandDataItem();
            item = (CommandDataItem)value;
            return base.GetDisplayText($"CommandDataItem");
        }
    }
}