Exemplo 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);
     }
 }
Exemplo 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);
            }
        }
Exemplo 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);
         }
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
            }
        }