Esempio n. 1
0
 private void AddSkipToFile(TruckInfo entry)
 {
     using (FixedObjectFileStream fos = new FixedObjectFileStream(skipFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) {
         entry.nrCrt = fos.NumberOfObjects + 1;
         fos.Add(entry);
     }
 }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 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);
         }
     }
 }
Esempio n. 4
0
 private void AddSkipToFile(TruckInfo entry)
 {
     using (FixedObjectFileStream fos = new FixedObjectFileStream(skipFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, true)) {
         entry.nrCrt = fos.NumberOfObjects + 1;
         fos.Add(entry);
     }
 }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
        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);
            }
        }