CK.Core.ActivityMonitor.SourceFilter.Update C# (CSharp) Method

Update() public static method

Updates (or simply scans) all existing filters.
When the mapper returns SourceLogFilter.Undefined, the file configuration is removed.
public static Update ( Func mapper ) : void
mapper Func /// Function that takes the file name, the existing filter and maps it to a new filter. ///
return void
            public static void Update( Func<string, SourceLogFilter, SourceLogFilter> mapper )
            {
                // Keys take a snapshot.
                // Iterating on the Keys is the preferred method for ConcurrentDictionary.
                foreach( var f in _filters.Keys )
                {
                    SourceLogFilter filter;
                    if( _filters.TryGetValue( f, out filter ) )
                    {
                        SetFilter( mapper( f, filter ), f );
                    }
                }
            }