Exemplo n.º 1
0
Arquivo: BOI.cs Projeto: 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();
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
Arquivo: BOI.cs Projeto: 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();
 }