コード例 #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;
 }
コード例 #2
0
        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;
                });
            });
        }
コード例 #3
0
        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;
                });
            });
        }
コード例 #4
0
 public LifetimeScopeHandler(IActiveItemRepository <LifetimeScope> lifetimeScopes)
 {
     if (lifetimeScopes == null)
     {
         throw new ArgumentNullException("lifetimeScopes");
     }
     _lifetimeScopes = lifetimeScopes;
 }
コード例 #5
0
 public RegistrationSourceAddedHandler(IActiveItemRepository <RegistrationSource> registrationSources)
 {
     if (registrationSources == null)
     {
         throw new ArgumentNullException("registrationSources");
     }
     _registrationSources = registrationSources;
 }
コード例 #6
0
 public TypeDiscoveredHandler(IActiveItemRepository <TypeData> typeData)
 {
     if (typeData == null)
     {
         throw new ArgumentNullException("typeData");
     }
     _typeData = typeData;
 }
コード例 #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;
 }
コード例 #8
0
 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;
 }