Exemple #1
0
 public Component(string id, TypeData limitType, IEnumerable<Service> services, OwnershipModel ownership, SharingModel sharing, IDictionary<string, string> metadata, ActivatorModel activator, LifetimeModel lifetime, string targetComponentId = null)
 {
     if (limitType == null) throw new ArgumentNullException("limitType");
     if (services == null) throw new ArgumentNullException("services");
     if (metadata == null) throw new ArgumentNullException("metadata");
     _id = id;
     _limitType = limitType;
     _services = services.ToArray();
     _ownership = ownership;
     _sharing = sharing;
     _metadata = metadata;
     _activator = activator;
     _lifetime = lifetime;
     _targetComponentId = targetComponentId;
 }
Exemple #2
0
        public Service(string description, TypeData serviceType = null, string key = null)
        {
            if (description == null) throw new ArgumentNullException("description");
            _serviceType = serviceType;
            _key = key;

            if (serviceType == null)
                _description = description;
            else
            {
                _description = serviceType.Identity.DisplayName;
                if (key != null)
                {
                    _description += " (" + key + ")";
                }
            }
        }