Example #1
0
 public InstanceLookupHandler(
     IActiveItemRepository <LifetimeScope> lifetimeScopes,
     IActiveItemRepository <ResolveOperation> resolveOperations,
     IActiveItemRepository <Component> components,
     IActiveItemRepository <InstanceLookup> instanceLookups)
 {
     if (lifetimeScopes == null)
     {
         throw new ArgumentNullException("lifetimeScopes");
     }
     if (resolveOperations == null)
     {
         throw new ArgumentNullException("resolveOperations");
     }
     if (components == null)
     {
         throw new ArgumentNullException("components");
     }
     if (instanceLookups == null)
     {
         throw new ArgumentNullException("instanceLookups");
     }
     _lifetimeScopes    = lifetimeScopes;
     _resolveOperations = resolveOperations;
     _components        = components;
     _instanceLookups   = instanceLookups;
 }
        public ComponentDetailViewModel(string componentId, IDispatcher dispatcher, IActiveItemRepository<Component> components)
        {
            dispatcher.Background(() =>
            {
                Component component;
                if (!components.TryGetItem(componentId, out component))
                    throw new ArgumentException("Unknown component.");

                var description = component.Description;
                var services = component.DescribeServices();
                var metadata = component.Metadata;
                var sharing = component.Sharing;
                var lifetime = component.Lifetime;
                var activator = component.Activator;
                var ownership = component.Ownership;
                var target = component.TargetComponentId;
                var id = component.Id;

                dispatcher.Foreground(() =>
                {
                    Description = description;
                    Metadata = metadata;
                    Services = services;
                    Sharing = sharing.ToString();
                    Lifetime = lifetime.ToString();
                    Activator = activator.ToString();
                    Ownership = ownership.ToString();
                    Target = target;
                    Id = id;
                });
            });
        }
        public ComponentDetailViewModel(string componentId, IDispatcher dispatcher, IActiveItemRepository <Component> components)
        {
            dispatcher.Background(() =>
            {
                Component component;
                if (!components.TryGetItem(componentId, out component))
                {
                    throw new ArgumentException("Unknown component.");
                }

                var description = component.Description;
                var services    = component.DescribeServices();
                var metadata    = component.Metadata;
                var sharing     = component.Sharing;
                var lifetime    = component.Lifetime;
                var activator   = component.Activator;
                var ownership   = component.Ownership;
                var target      = component.TargetComponentId;
                var id          = component.Id;

                dispatcher.Foreground(() =>
                {
                    Description = description;
                    Metadata    = metadata;
                    Services    = services;
                    Sharing     = sharing.ToString();
                    Lifetime    = lifetime.ToString();
                    Activator   = activator.ToString();
                    Ownership   = ownership.ToString();
                    Target      = target;
                    Id          = id;
                });
            });
        }
Example #4
0
 public LifetimeScopeHandler(IActiveItemRepository <LifetimeScope> lifetimeScopes)
 {
     if (lifetimeScopes == null)
     {
         throw new ArgumentNullException("lifetimeScopes");
     }
     _lifetimeScopes = lifetimeScopes;
 }
 public RegistrationSourceAddedHandler(IActiveItemRepository <RegistrationSource> registrationSources)
 {
     if (registrationSources == null)
     {
         throw new ArgumentNullException("registrationSources");
     }
     _registrationSources = registrationSources;
 }
Example #6
0
 public TypeDiscoveredHandler(IActiveItemRepository <TypeData> typeData)
 {
     if (typeData == null)
     {
         throw new ArgumentNullException("typeData");
     }
     _typeData = typeData;
 }
Example #7
0
 public ComponentAddedHandler(IActiveItemRepository <Component> components, IActiveItemRepository <TypeData> types)
 {
     if (components == null)
     {
         throw new ArgumentNullException("components");
     }
     if (types == null)
     {
         throw new ArgumentNullException("types");
     }
     _components = components;
     _types      = types;
 }
 public ResolveOperationHandler(
     IActiveItemRepository <ResolveOperation> resolveOperations,
     IActiveItemRepository <LifetimeScope> lifetimeScopes,
     IActiveItemRepository <Thread> threads)
 {
     if (resolveOperations == null)
     {
         throw new ArgumentNullException("resolveOperations");
     }
     if (lifetimeScopes == null)
     {
         throw new ArgumentNullException("lifetimeScopes");
     }
     if (threads == null)
     {
         throw new ArgumentNullException("threads");
     }
     _resolveOperations = resolveOperations;
     _lifetimeScopes    = lifetimeScopes;
     _threads           = threads;
 }