Exemple #1
0
 /// <summary>
 /// Creates a new chunk for data containers
 /// </summary>
 /// <param name="dc">DataContainer</param>
 public void CreateChunk( DataContainer dc )
 {
     try {
         if ( !all_indexes.Keys.Contains(dc.GetIndex()) ) {
             var filepath = CurrentDbPath +@"/dc_"+ dc.Name + ".dwarf";
             if ( !File.Exists( filepath ) ) {
                 ChunkFormat.AddItem( filepath, dc);
                 var index = dc.GetIndex();
                 all_indexes[index] = new KeyValuePair<IStructure, string>(dc, dc.GetIndex().DwarfHashCode);
                 chunks_lst.Add( new IndexPair() {
                                	hash_min =  index.DwarfHashCode, hash_max =  index.DwarfHashCode
                                }, dc.Name );
             }
         }
     } catch ( IOException ex ) {
         throw new ChunkException( "Error writing a new chunk!", ex );
     }
 }