Beispiel #1
0
 public void RegisterIfNotExist(IAssemblyList list, Assembly assembly)
 {
     if (!ContainsChecker.Contains(list, assembly))
     {
         AssemblyAdder.Add(list, assembly);
     }
 }
Beispiel #2
0
        public void RegisterIfNotExist(IAssemblyList list, Type type)
        {
            Assembly ass = type.Assembly;

            if (!ContainsChecker.Contains(list, ass))
            {
                AssemblyAdder.Add(list, ass);
            }
        }
 public BindingBuilder(ITypeInferrer typeInferrer,
                       IPropertyProvider propertyProvider,
                       IAssemblyList assemblies,
                       IResourceBuilder resourceBuilder)
 {
     _typeInferrer            = typeInferrer;
     _propertyProvider        = propertyProvider;
     _assemblies              = assemblies;
     _resourceBuilder         = resourceBuilder;
     _cachedPropertyAccessors = new DoubleConcurrentDictionary <Type, String, IPropertyAccessor>();
 }
        public IEnumerable <Type> FindImplementations(IAssemblyList assemblies, Type @interface)
        {
            foreach (Assembly assembly in assemblies.GetAssemblies())
            {
                foreach (Type @class in assembly.GetTypes().Where(x => x.IsClass))
                {
                    if (@interface.IsAssignableFrom(@class))
                    {
                        yield return(@class);
                    }
                }
            }

            RegisteredTypes = new List <Type>();
        }
Beispiel #5
0
        public IEnumerable <IService> GenerateServices(Type type, IAssemblyList assemblies, object instance = null, IConstructorParameters constructorParameters = null)
        {
            if (TypeIsClassValidator.Validate(type))
            {
                IService service = ServiceGenerator.GenerateService(type, instance, constructorParameters);
                yield return(service);
            }

            else
            {
                IEnumerable <Type> types = ImplementationsFinder.FindImplementations(assemblies, type);

                foreach (Type @class in types)
                {
                    IService service = ServiceGenerator.GenerateService(@class, null, constructorParameters);
                    yield return(service);
                }
            }
        }
Beispiel #6
0
		public WorkspaceModel()
		{
			this.assemblyLists = new SimpleModelCollection<IAssemblyList>();
			this.MainAssemblyList = new AssemblyList();
			this.UnpinnedAssemblies = new AssemblyList();
		}
 public WorkspaceModel()
 {
     this.assemblyLists      = new SimpleModelCollection <IAssemblyList>();
     this.MainAssemblyList   = new AssemblyList();
     this.UnpinnedAssemblies = new AssemblyList();
 }
Beispiel #8
0
 public void Register(IAssemblyList list, Assembly assembly)
 {
     AssemblyAdder.Add(list, assembly);
 }
 public void Add(IAssemblyList list, Assembly assembly)
 {
     list.AddAssembly(assembly);
 }
Beispiel #10
0
        public bool Contains(IAssemblyList list, Assembly assembly)
        {
            List <Assembly> assemblies = list.GetAssemblies();

            return(assemblies.Contains(assembly));
        }