internal SingletonApplicationImpl(
            SingletonApplicationModel applicationModel,
            IEnumerable <Tuple <CompositeModelType, CompositeModelTypeModelScopeSupport> > compositeModelTypeSupport,
            ApplicationValidationResultIQ validationResult,
            DictionaryQuery <CompositeModel, PublicCompositeTypeGenerationResult> loadingResults,
            String name,
            String mode,
            String version
            )
            : base(
                applicationModel,
                compositeModelTypeSupport,
                name,
                mode,
                version
                )
        {
            this._modelInfoContainer       = new ModelInfoContainerImpl(this.InternalModelSupport, applicationModel.CompositeModelsInThisContainer, validationResult, loadingResults, this.CollectionsFactory, applicationModel.GenericPropertyMixinType, applicationModel.GenericEventMixinType);
            this._structureServiceProvider = new StructureServiceProviderImpl(
                this,
                this.ModelTypeSupport,
                matcher => applicationModel.CompositeModelsInThisContainer
                .Where(matcher)
                .Select(model => Tuple.Create <CompositeInstanceStructureOwner, CompositeModel>(this, model))
                );

            this._serviceContainer = new ThreadsafeServiceContainer();
        }
Exemple #2
0
      internal ModuleImpl( ApplicationValidationResultIQ validationResult, DictionaryQuery<CompositeModel, PublicCompositeTypeGenerationResult> loadingResults, LayerImpl layer, ModuleModel model )
      {
         ArgumentValidator.ValidateNotNull( "Layer instance", layer );
         ArgumentValidator.ValidateNotNull( "Module model", model );

         this._layer = layer;
         this._moduleModel = model;
         this._serviceContainer = new ThreadsafeServiceContainer();
         this._modelInfoContainer = new ModelInfoContainerImpl(
            layer.InternalApplication.ModelTypeSupportInternal,
            model.CompositeModelsInThisContainer,
            validationResult,
            loadingResults,
            layer.Application.CollectionsFactory,
            model.LayerModel.ApplicationModel.GenericPropertyMixinType,
            model.LayerModel.ApplicationModel.GenericEventMixinType
            );
#if SILVERLIGHT
         this._compositeTypeLookupCache = new Dictionary<CompositeModelType, IDictionary<Type[], Tuple<CompositeInstanceStructureOwner, CompositeModel>>>();
#else
         this._compositeTypeLookupCache = new System.Collections.Concurrent.ConcurrentDictionary<CompositeModelType, System.Collections.Concurrent.ConcurrentDictionary<Type[], Tuple<CompositeInstanceStructureOwner, CompositeModel>>>();
#endif

         this._serviceProvider = new StructureServiceProviderImpl(
            this,
            layer.InternalApplication.ModelTypeSupportInternal,
            matcher => this.FindVisibleModels( matcher )
            );
      }
        public virtual CompositeBuilder CreateBuilder(StructureServiceProviderSPI structureServiceProvider, Type[] compositeTypes)
        {
            ThrowIfGenericParams(compositeTypes);
            CompositeModel       model = structureServiceProvider.Structure.ModelInfoContainer.GetCompositeModelInfo(this.ModelScopeSupport.AssemblyScopeSupport.ModelType, compositeTypes).Model;
            UsesContainerMutable uses  = UsesContainerMutableImpl.CreateWithParent(model.UsesContainer);

            return(new CompositeBuilderImpl(compositeTypes, uses, (CompositeInstanceImpl)this.CreateInstance(structureServiceProvider.Structure, model, compositeTypes, uses.Query)));
        }
        public override CompositeBuilder CreateBuilder(StructureServiceProviderSPI structureServiceProvider, Type[] compositeTypes)
        {
            CompositeModelType mType = this.ModelScopeSupport.AssemblyScopeSupport.ModelType;

            throw new InvalidCompositeModelTypeException(mType, "Composite builders can not be used to create composites of type " + mType + ".");
        }
 public override CompositeBuilder CreateBuilder(StructureServiceProviderSPI structureServiceProvider, Type[] compositeTypes)
 {
     return(ModuleImpl.CreateBuilder(this, structureServiceProvider.Structure, this.ModelScopeSupport.AssemblyScopeSupport.ModelType, compositeTypes));
 }