Beispiel #1
0
        /// <summary>
        /// Unregisters a service with a name. When this method is called,
        /// everything related is removed.
        /// </summary>
        /// <param name="interfaceType"></param>
        /// <param name="name"></param>
        public void Unregister(Type interfaceType, string name)
        {
            if (interfaceType == null)
            {
                throw new ArgumentNullException("interfaceType");
            }
            if (IsNameNullOrValid(name) == false)
            {
                throw new ArgumentNullException("name");
            }

            var typeAndName = new TypeAndName(interfaceType, name);

            Type type;

            RegisteredTypes.TryRemove(typeAndName, out type);

            CleanupServices(interfaceType, name);
        }