예제 #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();
 }