ServiceData RegisterService( FinalConfiguration finalConfig, IServiceInfo s ) { ServiceData data; if( _services.TryGetValue( s.ServiceFullName, out data ) ) return data; //Set default status ConfigurationStatus serviceStatus = finalConfig.GetStatus( s.ServiceFullName ); // Handle generalization. ServiceData dataGen = null; if( s.Generalization != null ) { dataGen = RegisterService( finalConfig, s.Generalization ); } Debug.Assert( (s.Generalization == null) == (dataGen == null) ); if( dataGen == null ) { data = new ServiceData( this, s, serviceStatus ); _serviceFamilies.Add( data.Family ); } else { data = new ServiceData( s, dataGen, serviceStatus ); } _services.Add( s.ServiceFullName, data ); return data; }
PluginData RegisterPlugin( FinalConfiguration finalConfig, IPluginInfo p ) { PluginData data; if( _plugins.TryGetValue( p.PluginFullName, out data ) ) return data; ConfigurationStatus pluginStatus = finalConfig.GetStatus( p.PluginFullName ); ServiceData service = p.Service != null ? _services[p.Service.ServiceFullName] : null; if( service == null ) ++_independentPluginsCount; data = new PluginData( this, p, service, pluginStatus ); _plugins.Add( p.PluginFullName, data ); return data; }