public StandardSingletonDeclaration( SingletonId id, List <TypeValuePair> args, SingletonTypes type, object singletonSpecificId) { Id = id; Type = type; SpecificId = singletonSpecificId; Arguments = args; }
public SingletonTypes?TryGetSingletonType(SingletonId id) { SingletonTypes type; if (_singletonTypes.TryGetValue(id, out type)) { return(type); } return(null); }
public void MarkSingleton(SingletonId id, SingletonTypes type) { SingletonTypes existingType; if (_singletonTypes.TryGetValue(id, out existingType)) { if (existingType != type) { throw Assert.CreateException( "Cannot use both '{0}' and '{1}' for the same type/concreteIdentifier!", existingType, type); } } else { _singletonTypes.Add(id, type); } }