Exemple #1
0
 public FormAdd(BindingSource bindingSource, Form1 form1, List <Tribe> tribeList)
 {
     InitializeComponent();
     this.form1 = form1;
     vGridControl1.DataSource = bindingSource;
     if (bindingSource.DataSource is Tribe)
     {
         checkedListBoxControl1.Visible = false;
     }
     if (bindingSource.DataSource is Dwarf)
     {
         checkedListBoxControl1.DataSource = DoStuff.FindAllTribeNames(tribeList);
     }
     if (bindingSource.DataSource is Weapon)
     {
         checkedListBoxControl1.DataSource = DoStuff.FindAllDwarfNames(tribeList);
     }
 }
 public FormRemove(Object context, Form1 form1, List <Tribe> tribeList)
 {
     InitializeComponent();
     this.form1     = form1;
     this.context   = context;
     this.tribeList = tribeList;
     if (context is Tribe tribe)
     {
         checkedListBoxControlRemove.DataSource = DoStuff.FindAllTribeNames(tribeList);
     }
     if (context is Dwarf dwarf)
     {
         checkedListBoxControlRemove.DataSource = DoStuff.FindAllDwarfNames(tribeList);
     }
     if (context is Weapon weapon)
     {
         checkedListBoxControlRemove.DataSource = DoStuff.FindAllWeaponsWithDwarfName(DoStuff.FindAllDwarfs(tribeList));
     }
 }