public FileRepositoryConfig Build()
 {
     this.entityPropertiesForFiles.OnMissing = entityType => new EntityPropertiesForFile(entityType);
     var filePathResolver = new FilePathResolver(this.entityPropertiesForFiles, this.rootPathFolder, this.fileExtension);
     var connectionResolver = new FileConnectionResolver(this.entityPropertiesForFiles, filePathResolver);
     this.disposeStrategy = this.disposeStrategy ?? new DisposeConnectionResolver(connectionResolver);
     this.insertStrategy = this.insertStrategy ?? new FileInsert(connectionResolver, this.outputConventions, this.delimitor, this.fieldQualifier);
     this.fileEntityFactoryStrategy = this.fileEntityFactoryStrategy ??
                                         (string.IsNullOrEmpty(this.delimitor)
                                          ? (IFileEntityFactoryStrategy) new ConstructorContainsLine()
                                          : new ConstructByEvaluatingDelimitedFile(this.delimitor, this.fieldQualifier));
     return new FileRepositoryConfig
         {
             ConnectionResolver = connectionResolver,
             Indexes = this.indexes,
             EntityFactoryStrategy = this.fileEntityFactoryStrategy,
             DisposeStrategy = this.disposeStrategy,
             InsertStrategy = this.insertStrategy,
             NextIdStrategy = this.nextIdStrategy,
             SetIdStrategy = this.setIdStrategy,
             PersistedDataPath = this.persistedDataPath
         };
 }
Exemple #2
0
    /// <summary>
    /// Creates a new AABBTree.
    /// </summary>
    /// <param name="fattenDelta">How much to fatten the aabbs (to avoid updating the nodes too frequently when the underlying data moves/resizes).</param>
    /// <param name="insertStrategy">Strategy to use for choosing where to insert a new leaf. Defaults to `InsertStrategyPerimeter`.</param>
    /// <returns></returns>
    public AABBTree(IInsertStrategy <T> insertStrategy, float fattenDelta = 10)
    {
        this.FattenDelta = fattenDelta;

        this.InsertStrategy = insertStrategy != null ? insertStrategy : new InsertStrategyPerimeter <T>();
    }