Пример #1
0
Файл: BOI.cs Проект: thalber/BOI
 //overload for manual checks/unchecks
 private void ApplyModlist(CheckState[] cst)
 {
     Wood.WriteLine("Applying modlist from manual check.");
     if (cst != null && cst.Length == Modlist.Items.Count)
     {
         for (int i = 0; i < cst.Length; i++)
         {
             if (Modlist.Items[i] is ModRelay)
             {
                 ModRelay mr = Modlist.Items[i] as ModRelay;
                 if (cst[i] == CheckState.Checked)
                 {
                     mr.Enable();
                 }
                 else
                 {
                     mr.Disable();
                 }
             }
         }
     }
 }
Пример #2
0
Файл: BOI.cs Проект: thalber/BOI
 private void ApplyModlist()
 {
     Wood.WriteLine("Applying modlist.");
     Wood.Indent();
     for (int i = 0; i < Modlist.Items.Count; i++)
     {
         if (Modlist.Items[i] is ModRelay)
         {
             ModRelay mr = Modlist.Items[i] as ModRelay;
             if (Modlist.GetItemChecked(i))
             {
                 mr.Enable();
             }
             else
             {
                 mr.Disable();
             }
             Wood.WriteLine(mr.AssociatedModData.DisplayedName + " : " + ((mr.enabled) ? "ON" : "OFF"));
         }
     }
     Wood.Unindent();
 }