public RulesConfiguration Clone() { var rc = new RulesConfiguration(); rc.RuleSets = (from rs in this.RuleSets select rs.Clone()).ToList(); return(rc); }
private void initializeSelectRules() { var rules = from r in dblint.AllExecutables select new RuleConfiguration(r); selectRules.DataContext = rules; var rulesconf = new RulesConfiguration(); rulesconf.RuleSets = new RuleSet[] { new RuleSet() { Include = true, Name = "Metadata rules", Rules = (from r in dblint.AllExecutables.GetSchemaRules() orderby r.Name select new Rule(r)).ToList(), IsSQLRuleSet = false }, new RuleSet() { Include = true, Name = "User-defined rules", Rules = (from r in dblint.AllExecutables.GetSQLRules() orderby r.Name select new Rule(r) { Include = true }).ToList(), IsSQLRuleSet = true }, new RuleSet() { Include = false, Name = "Data rules", Rules = (from r in dblint.AllExecutables.GetDataRules() orderby r.Name select new Rule(r) { Include = false }).ToList(), IsSQLRuleSet = false } }; vm.RulesConfiguration = rulesconf; selectRules.DataContext = selectRules.RuleConf = rulesconf; }