Пример #1
0
 //overload for manual checks/unchecks
 private void ApplyModlist(CheckState[] cst)
 {
     Debug.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
 private void ApplyModlist()
 {
     Debug.WriteLine("Applying modlist.");
     Debug.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();
             }
             Debug.WriteLine(mr.AssociatedModData.DisplayedName + " : " + ((mr.enabled) ? "ON" : "OFF"));
         }
     }
     Debug.Unindent();
 }