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; }
/// <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(); } }
public static string ToSerialString(this ArchiveStatus value) => value switch {
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; } }
protected Archive(FileTable table) { fileTable = table; archiveStatus = ArchiveStatus.Open; }