コード例 #1
0
ファイル: ModuleImpl.cs プロジェクト: CometaSolutions/Qi4CS
      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 )
            );
      }
コード例 #2
0
        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();
        }