public ModelRepository GetReferential(FileInfo directoryPath) { var fullname = directoryPath.Directory.FullName; if (!_referentials.TryGetValue(fullname, out ModelRepository model)) { _referentials.Add(fullname, (model = new Bb.Galileo.Files.ModelRepository(fullname, new Diag()))); model.Initialize(); } return(model); }
public FileRepository(string folder, IDiagnostic diagnostic, ModelRepository modelRepository) { this._folder = new DirectoryInfo(folder); this._diagnostic = diagnostic; this.Models = modelRepository; _watchers = new List <FileWatcher>() { new FileWatcher(this, "*.schema.json"), new FileWatcher(this, "*.defs.json"), new FileWatcher(this, "*.entities.json"), new FileWatcher(this, "*.links.json"), }; this._items = new Dictionary <string, FileModel>(); }
public IEnumerable <IBase> GetReferentials(ModelRepository rep) { QueryFilter query = new QueryFilter(); Type type = null; switch (this.Kind) { case ElementEnum.Entity: type = typeof(ReferentialEntity); if (!string.IsNullOrEmpty(this.Identifier)) { query.AddName(this.Identifier); } if (!string.IsNullOrEmpty(this.TypeName)) { query.AddTypeName(this.TypeName); } break; case ElementEnum.Relationship: type = typeof(ReferentialRelationship); if (!string.IsNullOrEmpty(this.Identifier)) { query.AddName(this.Identifier); } if (!string.IsNullOrEmpty(this.TypeName)) { query.AddTypeName(this.TypeName); } break; case ElementEnum.RelationshipDefinition: type = typeof(RelationshipDefinition); if (!string.IsNullOrEmpty(this.TypeName)) { query.AddName(this.TypeName); } break; case ElementEnum.EntityDefinition: type = typeof(EntityDefinition); if (!string.IsNullOrEmpty(this.TypeName) && this.TypeName != "*") { query.AddName(this.TypeName); } break; case ElementEnum.RestrictionDefinition: default: break; } if (type != null) { var source = rep.Get(type, query).ToList(); return(source); } return(new IBase[0]); }
public TypesIndex(ModelRepository parent) { this._parent = parent; _items = new Dictionary <string, TargetListIndex>(); }
public SchemaValidator(ModelRepository modelRepository) { this._parent = modelRepository; }
public ModelIndex(ModelRepository parent, string targetName) { this._parent = parent; this.TargetName = targetName; _items = new Dictionary <string, ReferentialBase>(); }
public SchemaManager(ModelRepository modelRepository) { this._parent = modelRepository; }
public Loader(ModelRepository parent) { this._parent = parent; }