public DataFileBase() { this.isOpen = false; this.tables = new DataTableCollection(); this.commandQueue = new PIPS.Utilities.EventQueue(); this.commandQueue.EventOccurred += new PIPS.Utilities.EventQueueHandler(CommandOccurred); }
public HotList(string directory) { this.available = true; DateTime start = DateTime.Now; this.dataFiles = new DataFileCollection(); this.directory = directory; if (Directory.Exists(this.directory)) { string[] files = Directory.GetFiles(this.directory, HotListDataFile.SearchPattern); if (files != null) { foreach (string file in files) { this.dataFiles.Add(new HotListDataFile(file)); } ArrayList results = new ArrayList(); foreach (HotListDataFile hl in this.dataFiles) { results.Add(hl.BeginInitialize()); } for (int i = 0; i < results.Count; i++) { this.dataFiles[i].EndInitialize(results[i] as IAsyncResult); } } } this.eq = new PIPS.Utilities.EventQueue(); this.eq.EventOccurred += new PIPS.Utilities.EventQueueHandler(FindCallback); insertEvent = this.GetLastDataFile().HotList.CreateHotListDataEvent(); //PIPS.Logger.WriteLine(false, "Hotlist.Initialize({0}, {1})", (DateTime.Now - start).TotalMilliseconds, directory); }
public void Dispose() { if (this.eq != null) { try { this.eq.Dispose(); } catch {} this.eq = null; } if (this.dataFiles != null) { try { this.Close(); } catch {} this.dataFiles = null; } }
public virtual void Dispose() { if (this.commandQueue != null) { try { this.commandQueue.Dispose(); } catch {} this.commandQueue = null; } if (this.tables != null) { try { foreach (DataTableBase table in this.tables) { try { table.Dispose(); } catch {} } this.tables.Clear(); } catch {} this.tables = null; } if (this.command != null) { try { this.command.Dispose(); } catch {} this.command = null; } if (this.connection != null) { try { this.connection.Dispose(); } catch {} this.connection = null; } }