public StandardSingletonDeclaration(
     SingletonId id, List <TypeValuePair> args, SingletonTypes type, object singletonSpecificId)
 {
     Id         = id;
     Type       = type;
     SpecificId = singletonSpecificId;
     Arguments  = args;
 }
Example #2
0
        public SingletonTypes?TryGetSingletonType(SingletonId id)
        {
            SingletonTypes type;

            if (_singletonTypes.TryGetValue(id, out type))
            {
                return(type);
            }

            return(null);
        }
Example #3
0
        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);
            }
        }