Esempio n. 1
0
        public Archive(string filename, ArchiveMode mode)
        {
            if (mode == ArchiveMode.Open)
            {
                Open(filename);
            }
            else
            {
                Create(filename);
            }

            // The archive was successfuly opened (or created).
            archiveStatus = ArchiveStatus.Open;
        }
Esempio n. 2
0
        /// <summary>
        /// Closes the archive.
        /// </summary>
        public void Close()
        {
            // Generate the ArchiveClosing event to inform users of this archive.
            if (ArchiveClosing != null)
            {
                ArchiveClosing(this, new EventArgs());
            }

            // Set the new status, and close the stream.
            archiveStatus = ArchiveStatus.Closed;
            if (archiveFile != null)
            {
                archiveFile.Close();
            }
        }
Esempio n. 3
0
 public static string ToSerialString(this ArchiveStatus value) => value switch
 {
Esempio n. 4
0
 public static bool updateArchive(Evercam evercam, string camera_id, string archive_id, int total_frames, ArchiveStatus status)
 {
     try
     {
         ArchiveInfo archiveInfo = new ArchiveInfo();
         archiveInfo.CameraId = camera_id;
         archiveInfo.ID = archive_id;
         archiveInfo.Status = status;
         archiveInfo.Frames = total_frames;
         var res = evercam.UpdateArchive(archiveInfo);
         return true;
     }
     catch (Exception ex) {
         Console.WriteLine(ex.ToString());
         return false;
     }
 }
Esempio n. 5
0
 protected Archive(FileTable table)
 {
     fileTable     = table;
     archiveStatus = ArchiveStatus.Open;
 }