private void MarkSelectedItems() { if (this.Group == null) { return; } this.ItemCheck -= new ItemCheckEventHandler(OnItemCheck); int index = 0; TourCostRuleCollection rules = DomainModel.TourCostRules.GetAll(); foreach (TourCostRule rule in rules) { if (this.Group.Rules.Contains(rule)) { SetItemCheckState(index, CheckState.Checked); } else { SetItemCheckState(index, CheckState.Unchecked); } index++; } this.ItemCheck += new ItemCheckEventHandler(OnItemCheck); }
private static void LoadRules() { rules = new TourCostRuleCollection(); // Load rules repo.LoadAll(rules); // Load rule constraints foreach (TourCostRule rule in rules) { DomainModel.TourRuleConstraints.Load(rule); } }