コード例 #1
0
        public virtual bool MatchesFilter(global::FoxTunes.ConfigurationSection section)
        {
            if (string.IsNullOrEmpty(this.Filter))
            {
                return(true);
            }
            var values = new[] { section.Name, section.Description };

            foreach (var value in values)
            {
                if (!string.IsNullOrEmpty(value) && value.Contains(this.Filter, true))
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #2
0
 public ConfigurationSection(ComponentSettings componentSettings, global::FoxTunes.ConfigurationSection section, string path = null) : this()
 {
     this.ComponentSettings = componentSettings;
     this.Section           = section;
     this.Path = path;
     if (string.IsNullOrEmpty(this.Path))
     {
         foreach (var element in this.Section.Elements.OrderBy(element => element.Id))
         {
             if (!componentSettings.MatchesFilter(this.Section, false) && !componentSettings.MatchesFilter(element))
             {
                 continue;
             }
             this.AddElement(element);
         }
     }
 }