Exemple #1
0
        public Countries() : base()
        {
            ObservableCollection <ISO3166Country> collection = ISO3166.BuildCountryCollection();

            // This collection built from Wikipedia entry on ISO3166-1 on 9th Feb 2016

            foreach (ISO3166Country country in collection)
            {
                Add(country);
            }
            this.OrderBy(x => x.Alpha3);
        }
Exemple #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string input = value as string;

            if (!string.IsNullOrEmpty(input))
            {
                if (input == "EUG" || input == "UEG")
                {
                    return(@"Images/uu.png");
                }
                else
                {
                    return(@"/FamFamFam.Flags.Wpf;component/Images/" + ISO3166.FromAlpha3(input).Alpha2 + ".png");
                }
            }
            else
            {
                return(@"/FamFamFam.Flags.Wpf;component/Images/xx.png");
            }
        }
Exemple #3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string      input = value as string;
            Juez        j     = new Juez();
            List <Juez> lj    = new List <Juez>();

            lj = MainWindow.jueces.Where(x => x.JudgeName == input).ToList();
            if (lj.Count > 0)
            {
                j = lj[0];
                if (j.Country.ToUpper() == "EUG" || j.Country.ToUpper() == "UEG")
                {
                    return(@"Images/uu.png");
                }
                else
                {
                    return(@"/FamFamFam.Flags.Wpf;component/Images/" + ISO3166.FromAlpha3(j.Country.ToUpper()).Alpha2 + ".png");
                }
            }
            else
            {
                return(null);
            }
        }