private void AddSkipToFile(TruckInfo entry) { using (FixedObjectFileStream fos = new FixedObjectFileStream(skipFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) { entry.nrCrt = fos.NumberOfObjects + 1; fos.Add(entry); } }
private void AddEntryToCompleted(TruckInfo entry) { if (!File.Exists(completedFile)) { Stream s = File.Create(completedFile); s.Write(BitConverter.GetBytes(0), 0, 4); s.Close(); } using (FixedObjectFileStream stream = new FixedObjectFileStream(completedFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) { entry.nrCrt = stream.NumberOfObjects + 1; stream.Add(entry); } }
private void AddEntryToFile(TruckInfo entry, bool first = false) { using (FixedObjectFileStream fos = new FixedObjectFileStream(dataFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) { if (first) { fos.Insert(0, entry); for (int i = 1; i < fos.NumberOfObjects; i++) { var e = fos[i]; e.nrCrt++; fos[i] = e; } } else { fos.Add(entry); } } }
private void AddSkipToFile(TruckInfo entry) { using (FixedObjectFileStream fos = new FixedObjectFileStream(skipFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) { entry.nrCrt = fos.NumberOfObjects + 1; fos.Add(entry); } }
private void AddEntryToFile(TruckInfo entry, bool first = false) { using (FixedObjectFileStream fos = new FixedObjectFileStream(dataFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) { if (first) { fos.Insert(0, entry); for (int i = 1; i < fos.NumberOfObjects; i++) { var e = fos[i]; e.nrCrt++; fos[i] = e; } } else fos.Add(entry); } }
private void AddEntryToCompleted(TruckInfo entry) { if (!File.Exists(completedFile)) { Stream s = File.Create(completedFile); s.Write(BitConverter.GetBytes(0), 0, 4); s.Close(); } using (FixedObjectFileStream stream = new FixedObjectFileStream(completedFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) { entry.nrCrt = stream.NumberOfObjects + 1; stream.Add(entry); } }