Example #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);
     }
 }
Example #2
0
 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));
     }
 }
Example #3
0
 public void RemoveChanges(Object context, string name)
 {
     tribeList = DoStuff.RemoveDataFromList(context, tribeList, name);
     SetTaxes();
     gridControl.RefreshDataSource();
 }
Example #4
0
 public void AddChanges(BindingSource bindingSource, string name)
 {
     tribeList = DoStuff.AddDataToList(bindingSource, tribeList, name);
     SetTaxes();
     gridControl.RefreshDataSource();
 }