internal void UpdateFrom( ILogConfig l, bool trackChanges )
{
bool hasChanged = false;
foreach( ILogServiceConfig s in l.Services )
{
VMLogServiceConfig vmS;
vmS = Find( s.Name );
if( vmS != null ) //The vm already exists
{
vmS.UpdateFrom( s, trackChanges );
}
else
{
vmS = VMLogServiceConfig.CreateFrom( this, s );
EventRegistration( vmS );
vmS.UpdateFrom( s, trackChanges );
if( trackChanges ) vmS.IsDirty = true; //If we create a new service from another source than the kernel, it must be set to dirty
_services.Add( vmS );
}
}
if( l.DoLog != DoLog )
{
DoLog = l.DoLog;
hasChanged = true;
}
if( !trackChanges ) IsDirty = false; // If we update from the kernel, conf is no longer dirty
else if( hasChanged ) IsDirty = true; // If we update from an other source and changes have been made in the logConfig's cocnf, conf is dirty. But if no changes have been made, conf stays the way it was before updating
if( !trackChanges )
Debug.Assert( IsDirty == false );
}