using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Media;

using BS.Shared.DataContracts;

using Color = System.Drawing.Color;

namespace BeWo.ViewModel.ListViewModel
{
    public class AssessmentSheetValueListVM : AbstractDCListMapperVM<AssessmentSheetValueDC, AssessmentSheetValueVM>
    {
        public AssessmentSheetValueListVM(List<AssessmentSheetValueDC> pDCs) : base(pDCs)
        {
        }

        public List<SolidColorBrush> AllBrushes
        {
            get
            {
                var lTemp = typeof(Color).GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Static).Select(pi => (Color)pi.GetGetMethod().Invoke(null, null)).ToList();

                lTemp.Sort((x, y) => x.GetBrightness().CompareTo(y.GetBrightness()));

                return lTemp.Select(c => new SolidColorBrush(System.Windows.Media.Color.FromArgb(c.A, c.R, c.G, c.B))).ToList();
            }
        }
    }
}