コード例 #1
0
ファイル: UsabilityConverter.cs プロジェクト: Kabolas/RPGDB
 private RPGEntities15 bdd;//= new RPGEntities15();
 public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
 {
     using (bdd = new RPGEntities15())
         if (bdd.Monde_w.Any(m => m.nom == (string)value))
         {
             return((string)value != "Technocosme" ? Visibility.Visible : Visibility.Hidden);
         }
         else
         {
             return(Visibility.Hidden);
         }
 }
コード例 #2
0
ファイル: UsabilityConverter.cs プロジェクト: Kabolas/RPGDB
 public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
 {
     if (value != null && ((Items)value).Id != 0)
     {
         using (bdd = new RPGEntities15())
         {
             Items temp = bdd.Items.ToList().Find(i => i.Id == (value as Items).Id);
             return(temp.GetType().GetProperty(parameter as string).GetValue(temp) == null);
         }
     }
     return(true);
 }
コード例 #3
0
ファイル: UsabilityConverter.cs プロジェクト: Kabolas/RPGDB
 private RPGEntities15 bdd;//= new RPGEntities15();
 public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
 {
     using (bdd = new RPGEntities15())
         if (bdd.Monde_w.Any(m => m.nom == (string)value))
         {
             return((string)value != "Magocosme");
         }
         else
         {
             return(false);
         }
 }
コード例 #4
0
ファイル: UsabilityConverter.cs プロジェクト: Kabolas/RPGDB
        public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
        {
            using (bdd = new RPGEntities15())
                switch ((string)value)
                {
                case "Armes": return(bdd.Items.Where(a => a.Weaponry != null).ToList());

                case "Armures": return(bdd.Items.Where(a => a.Armory != null).ToList());

                case "Véhicule":
                case "Vehicule": return(bdd.Items.Where(v => v.Vehicule != null).ToList());

                case "Munition":
                case "Munitions": return(bdd.Items.Where(m => m.Munition != null).ToList());

                case "Alliages": return(bdd.Items.Where(a => a.Alliage != null).ToList());

                case "Bijoux": return(bdd.Items.Where(b => b.Bijoux != null).ToList());

                case "Consommable": return(bdd.Items.Where(c => c.Consommables != null).ToList());

                case "Loot": return(bdd.Items.Where(l => l.Loot != null).ToList());

                case "Métaux": return(bdd.Items.Where(m => m.Mineraux != null && m.Mineraux.Minerai_type.type == "Métal").ToList());

                case "Parchemins": return(bdd.Items.Where(p => p.Parchemins != null).ToList());

                case "Pierres":
                case "Pierre": return(bdd.Items.Where(m => m.Mineraux != null && m.Mineraux.Minerai_type.type == "Pierre").ToList());

                case "Végétaux": return(bdd.Items.Where(v => v.Mineraux != null && v.Mineraux.Minerai_type.type == "Végétal").ToList());

                case "Conteneur": return(bdd.Items.Where(c => c.Conteneurs != null).ToList());

                case "Commun":
                case "Communs":
                    return(bdd.Items.Where(i => i.Armory == null && i.Mineraux == null && i.Bijoux == null &&
                                           i.Weaponry == null && i.Vehicule == null && i.Loot == null && i.Mineraux == null && i.Munition == null && i.Conteneurs == null && i.Consommables
                                           == null && i.Parchemins == null).ToList());

                default:
                    return(null);
                }
        }
コード例 #5
0
ファイル: UsabilityConverter.cs プロジェクト: Kabolas/RPGDB
 public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
 {
     using (bdd = new RPGEntities15())
         return(((Magie_type)value).ecole == "Tous" ? bdd.Sorts.ToList() : bdd.Sorts.ToList().FindAll(s => s.Magie_type == ((Magie_type)value)));
 }