Esempio n. 1
0
 /// <summary>
 /// Insert the new rule to the collection (+ DB)
 /// </summary>
 public RuleSet SaveNewRule(RuleSet newRule)
 {
     dbEntities.InsertNewRule(newRule);
     dbEntities.SaveAllChanges();
     rules.Add(newRule);
     return(dbEntities.GetAllRules(filterId).OrderBy(r => r.ID_Rule).Last());
 }
Esempio n. 2
0
        /// <summary>
        /// Returns the hexa code defined for the "Window" target, if there is one.
        /// Returns null otherwise
        /// </summary>
        private string RetrieveWindowColor(int iD_Filter)
        {
            RuleSet windowRule = _dbEntities.GetAllRules(iD_Filter).FirstOrDefault(r => r.TargetSet.Name.Equals("Window"));

            return(windowRule != null ? windowRule.HexaCode : null);
        }