public void ClearSuppressionRule(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers modifier)
 {
     for (int i = SuppressedRules.Count - 1; i >= 0; i--)
     {
         if (SuppressedRules[i].Rule == rule && String.Equals(((int)modifier).ToString(), SuppressedRules[i].RuleModifier))
         {
             SuppressedRules.RemoveAt(i);
         }
     }
 }
 public void ClearOverrideRule(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers modifier, AdditionalAccessoryVisibilityRules overrideRule, AdditionalAccessoryVisibilityRulesModifiers overrideModifier)
 {
     for (int i = OverrideRules.Count - 1; i >= 0; i--)
     {
         if (OverrideRules[i].Rule == rule && String.Equals(((int)modifier).ToString(), OverrideRules[i].RuleModifier) && OverrideRules[i].OverrideRule == overrideRule && String.Equals(((int)overrideModifier).ToString(), OverrideRules[i].OverrideRuleModifier))
         {
             OverrideRules.RemoveAt(i);
         }
     }
 }
 public void SetOverrideRule(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers modifier, AdditionalAccessoryVisibilityRules overrideRule, AdditionalAccessoryVisibilityRulesModifiers overrideModifier)
 {
     foreach (AdditionalAccessoryCoordinateRuleData oRule in OverrideRules)
     {
         if (oRule.Rule == rule && String.Equals(((int)modifier).ToString(), oRule.RuleModifier) && oRule.OverrideRule == overrideRule && String.Equals(((int)overrideModifier).ToString(), oRule.OverrideRuleModifier))
         {
             return;
         }
     }
     OverrideRules.Add(new AdditionalAccessoryCoordinateRuleData(rule, ((int)modifier).ToString(), overrideRule, ((int)overrideModifier).ToString()));
 }
 public void SetSuppressionRule(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers modifier, bool value)
 {
     if (value)
     {
         foreach (AdditionalAccessoryCoordinateRuleData suppressionRule in SuppressedRules)
         {
             if (suppressionRule.Rule == rule && String.Equals(((int)modifier).ToString(), suppressionRule.RuleModifier))
             {
                 return;
             }
         }
         SuppressedRules.Add(new AdditionalAccessoryCoordinateRuleData(rule, ((int)modifier).ToString(), AdditionalAccessoryVisibilityRules.NONE, null));
     }
     else
     {
         ClearSuppressionRule(rule, modifier);
     }
 }
        public void SetVisibilityRule(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers mod, bool enabled)
        {
            if (VisibilityRules == null)
            {
                VisibilityRules = new List <AdditionalAccessoryVisibilityRuleData>();
            }

            AdditionalAccessoryVisibilityRuleData foundRule = FindVisibilityRule(rule, mod);

            if (!enabled && foundRule != null)
            {
                VisibilityRules.Remove(foundRule);
            }
            else if (enabled)
            {
                VisibilityRules.Add(new AdditionalAccessoryVisibilityRuleData(rule, ((int)mod).ToString()));
            }
        }
 public List <AdditionalAccessoryCoordinateRuleData> GetOverrideTargets(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers modifier)
 {
     return(GetOverrideTargets(rule, ((int)modifier).ToString()));
 }
 public bool IsOverrideSource(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers modifier)
 {
     return(IsOverrideSource(rule, ((int)modifier).ToString()));
 }
 public bool IsSuppressed(AdditionalAccessoryVisibilityRules rule, AdditionalAccessoryVisibilityRulesModifiers modifier)
 {
     return(IsSuppressed(rule, ((int)modifier).ToString()));
 }
        public bool ContainsVisibilityRule(AdditionalAccessoryVisibilityRules checkRule, AdditionalAccessoryVisibilityRulesModifiers mod)
        {
            if (VisibilityRules == null)
            {
                return(false);
            }

            foreach (AdditionalAccessoryVisibilityRuleData rule in VisibilityRules)
            {
                AdditionalAccessoryVisibilityRulesModifiers modifier;
                bool isEnumModifier = Enum.TryParse(rule.Modifier, out modifier);

                if (rule.Rule.Equals(checkRule) && (isEnumModifier && modifier.Equals(mod)))
                {
                    return(true);
                }
            }
            return(false);
        }