private static ConfigurationMap GetConfigurationMap(Type type) { ConfigurationMap cm; if (!targets.ContainsKey(type)) { cm = new ConfigurationMap(type); targets[type] = cm; } else { cm = (ConfigurationMap)targets[type]; } return(cm); }
/// <summary> /// Configure all targets in the specified type (static members). /// </summary> /// <param name="configStoreName">The name of the handler to use as configuration source. /// If null is given, Gentle's configuration store will be used (effectively this means /// one of the automatically registered handlers).</param> /// <param name="type">The type to be configured</param> public static void Configure(string configStoreName, Type type) { InitializeHandlers(); lock ( cfgLock ) { // get target descriptor ConfigurationMap cm = GetConfigurationMap(type); // configure type (static members) if (configStoreName != null) { Check.Verify(namedHandlers.ContainsKey(configStoreName), Error.DeveloperError, "No handler has been registered with configStoreName of {0}.", configStoreName); IList list = new ArrayList(1); list.Add(namedHandlers[configStoreName]); cm.Configure(list, type); } else { cm.Configure(handlers, type); } } }
private static ConfigurationMap GetConfigurationMap( Type type ) { ConfigurationMap cm; if( ! targets.ContainsKey( type ) ) { cm = new ConfigurationMap( type ); targets[ type ] = cm; } else { cm = (ConfigurationMap) targets[ type ]; } return cm; }