예제 #1
0
        /// <summary>
        /// Registers and binds a link to already registered service with another id.
        /// </summary>
        public RegisteredServiceContext Bind(uint id, RegisteredServiceContext registeredServiceContext)
        {
            if (registeredServiceContext == null)
            {
                throw new ArgumentNullException("registeredServiceContext");
            }
            if (registeredServiceContext.ServiceObject == null)
            {
                throw new ArgumentException("Invalid context object", "registeredServiceContext");
            }

            RegisterServiceObject(_uintServices, id, registeredServiceContext.ServiceObject);
            return(registeredServiceContext);
        }
예제 #2
0
        /// <summary>
        /// Registers and binds a link to already registered service with another type.
        /// </summary>
        public RegisteredServiceContext Bind <T>(RegisteredServiceContext registeredServiceContext)
        {
            if (registeredServiceContext == null)
            {
                throw new ArgumentNullException("registeredServiceContext");
            }
            if (registeredServiceContext.ServiceObject == null)
            {
                throw new ArgumentException("Invalid context object", "registeredServiceContext");
            }

            RegisterServiceObject(_typeServices, typeof(T), registeredServiceContext.ServiceObject);
            return(registeredServiceContext);
        }
예제 #3
0
        /// <summary>
        /// Registers and binds a link to already registered service with another id.
        /// </summary>
        public RegisteredServiceContext Bind(IEnumerable <string> id, RegisteredServiceContext registeredServiceContext)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            if (registeredServiceContext == null)
            {
                throw new ArgumentNullException("registeredServiceContext");
            }
            if (registeredServiceContext.ServiceObject == null)
            {
                throw new ArgumentException("Invalid context object", "registeredServiceContext");
            }

            RegisterServiceObject(_stringServices, id, registeredServiceContext.ServiceObject);
            return(registeredServiceContext);
        }