CK.Plugins.ObjectExplorer.LogConfigExtensions.CombineWith C# (CSharp) Method

CombineWith() public static method

Creates a new ILogConfig that is a clone of this configuration with a clone of the ILogServiceConfig parameter.
public static CombineWith ( this config, ILogServiceConfig s ) : ILogConfig
config this This .
s ILogServiceConfig A which log configuration needs to be applied.
return ILogConfig
        public static ILogConfig CombineWith( this ILogConfig config, ILogServiceConfig s )
        {
            LogConfig c = (LogConfig)config.Clone();
            for( int i = 0; i < c.Services.Count; i++ )
            {
                if( c.Services[i].Name == s.Name )
                {
                    c.Services.RemoveAt( i );
                    break;
                }
            }
            c.Services.Add( Clone( s ) );
            return c;
        }
LogConfigExtensions