using System.Collections.Generic;
using System.Windows.Forms;

namespace Baza_Reklam.Classes.Helpers
{
    public class ComboBoxHelper
    {
        public static void Bind<T>(IEnumerable<T> list, ComboBox comboBox)
        {
            comboBox.Items.Clear();
            foreach (T item in list)
            {
                comboBox.Items.Add(item);
            }
        }

        public static void Bind<T>(IEnumerable<T> list, ComboBox comboBox, T defaultItem)
        {
            Bind(list, comboBox);

            comboBox.Items.Insert(0, defaultItem);
        }

        //public static int GetItemIndex<T>(T type, int value, ComboBox comboBox)
        //{
        //    foreach (object item in comboBox.Items)
        //    {
        //        if(((T)item))
        //        {
                    
        //        }
        //    }
        //}
    }
}