Exemplo n.º 1
0
 public override bool Equals(object obj)
 {
     if (obj == null)
     {
         return(false);
     }
     else
     {
         ColorWrapper otherKleur = (ColorWrapper)obj;
         return(Name.Equals(otherKleur.Name));
     }
 }
Exemplo n.º 2
0
        public static List <ColorWrapper> GetColorWrappers()
        {
            List <System.Windows.Media.Color> colors = GetColors();

            List <ColorWrapper> colorWrappers = new List <ColorWrapper>();

            foreach (System.Windows.Media.Color color in colors)
            {
                ColorWrapper colorWrapper = new ColorWrapper(color);
                colorWrappers.Add(colorWrapper);
            }

            colorWrappers.RemoveAll(k => String.IsNullOrEmpty(k.Name));
            return(colorWrappers.Distinct().OrderBy(c => c.Name).ToList());
        }