public static void Add(PInvokeWin32.USN_RECORD record) { FileEntry entry = new FileEntry(record.FileReferenceNumber, record.FileName, record.ParentFileReferenceNumber); if (LastUsn < record.Usn) { LastUsn = record.Usn; } mRefernumberMap.Add(entry.ReferenceNumber, entry); }
public static void Load() { Clear(); System.IO.StreamReader reader = new System.IO.StreamReader("database.db"); while(true) { string buffer = reader.ReadLine(); if (buffer != null && DB_PATTERN.IsMatch(buffer)) { Match m = DB_PATTERN.Match(buffer); FileEntry entry = new FileEntry(Convert.ToUInt64(m.Groups["ReferenceNumber"].Value), Convert.ToString(m.Groups["FileName"].Value), Convert.ToUInt64(m.Groups["ParentReferenceNumber"].Value)); mRefernumberMap[entry.ReferenceNumber] = entry; } else break; } reader.Close(); }