Exemplo n.º 1
0
 public Filter(string name, bool exclude, params FilterCondition[] conditions)
 {
     if (!string.IsNullOrEmpty(name))
     {
         Name = name;
     }
     Exclude = exclude;
     ComparisonEntries.AddRange(conditions);
 }
Exemplo n.º 2
0
        public Filter(string name, string filterText)
        {
            if (!string.IsNullOrEmpty(name))
            {
                Name = name;
            }

            if (string.IsNullOrEmpty(filterText))
            {
                throw new ArgumentException(Localisation.UninstallListItem_ValueEmpty, nameof(filterText));
            }

            if (filterText.ContainsAny(StringTools.NewLineChars, StringComparison.Ordinal))
            {
                throw new ArgumentException(Localisation.UninstallListItem_NewLineInValue, nameof(filterText));
            }

            ComparisonEntries.Add(new FilterCondition {
                FilterText = filterText
            });
        }