Exemplo n.º 1
0
 TypesInfo GetTypesInfo() {
     var typesInfo = new TypesInfo();
     typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo));
     var xpoSource = new XpoTypeInfoSource(typesInfo);
     typesInfo.AddEntityStore(xpoSource);
     XpandModuleBase.Dictiorary = xpoSource.XPDictionary;
     return typesInfo;
 }
Exemplo n.º 2
0
 TypesInfo GetTypesInfo() {
     var typesInfo = new TypesInfo();
     typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo));
     var xpoSource = new XpoTypeInfoSource(typesInfo);
     typesInfo.Source = xpoSource;
     typesInfo.AddEntityStore(xpoSource);
     return typesInfo;
 }
Exemplo n.º 3
0
        TypesInfo GetTypesInfo()
        {
            var typesInfo = new TypesInfo();

            typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo));
            var xpoSource = new XpoTypeInfoSource(typesInfo);

            typesInfo.Source = xpoSource;
            typesInfo.AddEntityStore(xpoSource);
            return(typesInfo);
        }
Exemplo n.º 4
0
        TypesInfo GetTypesInfo()
        {
            var typesInfo = new TypesInfo();

            typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo));
            var xpoSource = new XpoTypeInfoSource(typesInfo);

            typesInfo.AddEntityStore(xpoSource);
            XpandModuleBase.Dictiorary = xpoSource.XPDictionary;
            return(typesInfo);
        }
Exemplo n.º 5
0
        public bool Run(RuntimeSetupInfo setupInfo)
        {
            var typesInfo = new TypesInfo();

            typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo));
            var reflectionDictionary = new ReflectionDictionary(); reflectionDictionary.CollectClassInfos(typeof(ModuleArtifact).Assembly);
            var xpoTypeInfoSource    = new XpoTypeInfoSource(typesInfo, reflectionDictionary);

            typesInfo.AddEntityStore(xpoTypeInfoSource);
            typesInfo.LoadTypes(typeof(ModuleArtifact).Assembly);
            var exportedTypesFromAssembly = ModuleHelper.CollectExportedTypesFromAssembly(typeof(ModuleArtifact).Assembly, ExportedTypeHelpers.IsExportedType);

            foreach (var type in exportedTypesFromAssembly)
            {
                xpoTypeInfoSource.RegisterEntity(type);
            }

            var objectSpace = new XPObjectSpace(typesInfo, xpoTypeInfoSource, () => new UnitOfWork(reflectionDictionary)
            {
                ConnectionString = setupInfo.ConnectionString
            });

            if (!objectSpace.Contains <ModuleChild>())
            {
                var moduleTypes  = GetModuleTypes(setupInfo);
                var childModules = objectSpace.GetModuleChilds(moduleTypes);
                foreach (var childModule in childModules)
                {
                    childModule.Value.CreateArtifacts(childModule.Key);
                    childModule.Value.CreateExtenderInterfaces(childModule.Key);
                }
                UpdateMapViewModule(childModules, objectSpace);
            }
            CreateObjects(objectSpace, setupInfo);
            objectSpace.CommitChanges();
            return(true);
        }
Exemplo n.º 6
0
        private ValidatorResult ValidateCore(string assemblyPath)
        {
            var validatorResult = new ValidatorResult();

            try{
                using (var typesInfo = new TypesInfo()){
                    typesInfo.AddEntityStore(new XpoTypeInfoSource(typesInfo));
                    TypesInfoValidation(assemblyPath, typesInfo);
                    DataStoreValidation(typesInfo);
                }
            }
            catch (Exception e) {
                var exception = e;
                if (exception.InnerException != null)
                {
                    exception = e.InnerException;
                }
                validatorResult.Message = Tracing.Tracer.FormatExceptionReport(exception);
            }
            return(validatorResult);
        }
Exemplo n.º 7
0
 bool ValidateBOModel(IPersistentAssemblyInfo persistentAssemblyInfo, Type compileCore) {
     if (persistentAssemblyInfo.ValidateModelOnCompile) {
         try {
             var typesInfo = new TypesInfo();
             typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo));
             typesInfo.AddEntityStore(new XpoTypeInfoSource(typesInfo));
             typesInfo.LoadTypes(compileCore.Assembly);
             var applicationModulesManager = new ApplicationModulesManager();
             applicationModulesManager.AddModule(compileCore);
             applicationModulesManager.Load(typesInfo, true);
         } catch (Exception exception) {
             persistentAssemblyInfo.CompileErrors = exception.ToString();
             return false;
         }
     }
     return true;
 }
Exemplo n.º 8
0
        public bool Run(RuntimeSetupInfo setupInfo) {
            var typesInfo = new TypesInfo();
            typesInfo.AddEntityStore(new NonPersistentEntityStore(typesInfo));
            var reflectionDictionary = new ReflectionDictionary();reflectionDictionary.CollectClassInfos(typeof(ModuleArtifact).Assembly);
            var xpoTypeInfoSource = new XpoTypeInfoSource(typesInfo,reflectionDictionary);
            typesInfo.AddEntityStore(xpoTypeInfoSource);
            typesInfo.LoadTypes(typeof(ModuleArtifact).Assembly);
            var exportedTypesFromAssembly = ModuleHelper.CollectExportedTypesFromAssembly(typeof(ModuleArtifact).Assembly,ExportedTypeHelpers.IsExportedType);
            foreach (var type in exportedTypesFromAssembly){
                xpoTypeInfoSource.RegisterEntity(type);
            }

            var objectSpace = new XPObjectSpace(typesInfo, xpoTypeInfoSource, () => new UnitOfWork(reflectionDictionary){ ConnectionString = setupInfo.ConnectionString });
            if (!objectSpace.Contains<ModuleChild>()){
                var moduleTypes = GetModuleTypes(setupInfo);
                var childModules = objectSpace.GetModuleChilds(moduleTypes);
                foreach (var childModule in childModules){
                    childModule.Value.CreateArtifacts(childModule.Key);
                    childModule.Value.CreateExtenderInterfaces(childModule.Key);
                }
                UpdateMapViewModule(childModules, objectSpace);
            }
            CreateObjects(objectSpace, setupInfo);
            objectSpace.CommitChanges();
            return true;
        }