Beispiel #1
0
        /// <summary>
        /// Adds a SeatClassificationRule to the rule set
        /// </summary>
        /// <param name="rule">The rule to add</param>
        /// <param name="experimental">Indicates if this rule should be considered experimental or not</param>
        public void AddRule(SeatClassificationRule rule, bool experimental = true)
        {
            var list = experimental ? _experimentalRuleFile : _systemRuleFile;

            list.Add(rule);
            SetupCurrentRules();
        }
 /// <summary>
 /// Remove a SeatClassificationRule from the file
 /// </summary>
 /// <param name="rule"></param>
 public void Remove(SeatClassificationRule rule)
 {
     if (_rules.Remove(rule))
     {
         _changed = true;
     }
 }
 /// <summary>
 /// Add a SeatClassificationRule to the file
 /// </summary>
 /// <param name="rule"></param>
 public void Add(SeatClassificationRule rule)
 {
     if (!_rules.Contains(rule))
     {
         _rules.Add(rule);
         _changed = true;
     }
 }
Beispiel #4
0
 public void ToggleExperimental(SeatClassificationRule rule)
 {
     if (_systemRuleFile.Contains(rule))
     {
         _systemRuleFile.Remove(rule);
         _experimentalRuleFile.Add(rule);
     }
     else if (_experimentalRuleFile.Contains(rule))
     {
         _experimentalRuleFile.Remove(rule);
         _systemRuleFile.Add(rule);
     }
     SetupCurrentRules();
 }
Beispiel #5
0
        /// <summary>
        /// Removes the given SeatClassificationRule object from the rule set
        /// </summary>
        /// <param name="rule">The rule object to remove</param>
        public void RemoveRule(SeatClassificationRule rule)
        {
            var change = false;

            if (_systemRuleFile.Contains(rule))
            {
                _systemRuleFile.Remove(rule);
                change = true;
            }
            if (_experimentalRuleFile.Contains(rule))
            {
                _experimentalRuleFile.Remove(rule);
                change = true;
            }

            if (change)
            {
                SetupCurrentRules();
            }
        }
Beispiel #6
0
 protected bool Equals(SeatClassificationRule other)
 {
     return(string.Equals(_operatorName, other._operatorName) && _operatorValue == other._operatorValue &&
            string.Equals(RuleName, other.RuleName) && string.Equals(Notes, other.Notes) && Order == other.Order &&
            Field == other.Field && Status == other.Status);
 }
 public bool Contains(SeatClassificationRule rule)
 {
     return(_rules.Contains(rule));
 }