/// <summary> /// Creates a new source monitor /// </summary> /// <param name="solution">The solution to monitor</param> /// <param name="foldersToMonitor">A list of folders to monitor</param> /// <param name="scanInterval">The interval at which to scan the folders (in /// seconds) </param> /// <param name="baseDirectory">The base directory for this monitor</param> /// <param name="defaultArchive">The default archive to route files to</param> /// <param name="otherArchives">Other archives to route files to</param> public SourceMonitor(Solution solution, double scanInterval, TaskScheduler scheduler, string baseDirectory, AbstractArchive defaultArchive, SrcMLArchive sourceArchive, params AbstractArchive[] otherArchives) : base(DirectoryScanningMonitor.MONITOR_LIST_FILENAME, scanInterval, scheduler, baseDirectory, defaultArchive, otherArchives) { if(null != sourceArchive) { RegisterArchive(sourceArchive, false); } this.MonitoredSolution = solution; }
public RestorePoint(int id, DateTime time, long size, AbstractArchive archive, Type type) { Id = id; BackupSize = size; CreationTime = time; Files = archive; PointType = type; }
internal static void Extract <TEntry, TVolume>(this TEntry entry, AbstractArchive <TEntry, TVolume> archive, Stream streamToWriteTo) where TEntry : IArchiveEntry where TVolume : IVolume { if (entry.IsDirectory) { throw new ExtractionException("Entry is a file directory and cannot be extracted."); } archive.EnsureEntriesLoaded(); archive.FireEntryExtractionBegin(entry); archive.FireFilePartExtractionBegin(entry.FilePath, entry.Size, entry.CompressedSize); using (Stream stream = new ListeningStream(archive, entry.OpenEntryStream())) { stream.TransferTo(streamToWriteTo); } archive.FireEntryExtractionEnd(entry); }
public BackupInfo CreateBackup(List <AbstractFile> list, Type type) //бекапим все файлы и не храним инфу про каждый файл в бекапе(совместное хранение) { FileRestoreCopyInfo newFile; List <AbstractFile> files = new List <AbstractFile>(list); long size = 0; foreach (var t in list) { size += t.Filesize; newFile = System.CreateRestore(t); } AbstractArchive archive = new AbstractArchive(size, DateTime.Now, files); BackupInfo restoreInfo = new BackupInfo(size, type, archive); CreateRestorePoint(restoreInfo); return(restoreInfo); }
/// <summary> /// Constructor. /// </summary> /// <param name="openSolution"></param> /// <param name="baseDirectory"></param> /// <param name="defaultArchive"></param> /// <param name="otherArchives"></param> public SolutionMonitor(SolutionWrapper openSolution, string baseDirectory, AbstractArchive defaultArchive, params AbstractArchive[] otherArchives) : base(baseDirectory, defaultArchive, otherArchives) { this.OpenSolution = openSolution; }
protected ArchiveDevice(Stream archiveStream) { _archiveStream = archiveStream; _archive = OpenArchive(archiveStream); }
/// <summary> /// Creates a new source monitor /// </summary> /// <param name="solution">The solution to monitor</param> /// <param name="foldersToMonitor">A list of folders to monitor</param> /// <param name="baseDirectory">The base directory for this monitor</param> /// <param name="defaultArchive">The default archive to route files to</param> /// <param name="otherArchives">Other archives to route files to</param> public SourceMonitor(Solution solution, string baseDirectory, AbstractArchive defaultArchive, SrcMLArchive sourceArchive, params AbstractArchive[] otherArchives) : this(solution, DEFAULT_SCAN_INTERVAL, TaskScheduler.Default, baseDirectory, defaultArchive, sourceArchive, otherArchives) { }
/// <summary> /// Create an instance of solution monitor. /// </summary> /// <param name="openSolution"></param> /// <param name="SrcMLServiceDirectory"></param> /// <param name="lastModifiedArchive"></param> /// <param name="CurrentSrcMLArchive"></param> /// <returns></returns> private static SolutionMonitor CreateMonitor(Solution openSolution, string SrcMLServiceDirectory, AbstractArchive lastModifiedArchive, params AbstractArchive[] CurrentSrcMLArchive) { Contract.Requires(openSolution != null, "A solution must be open"); var currentMonitor = new SolutionMonitor(SolutionWrapper.Create(openSolution), SrcMLServiceDirectory, lastModifiedArchive, CurrentSrcMLArchive); return(currentMonitor); }
/// <summary> /// Create an instance of solution monitor. /// </summary> /// <param name="SrcMLServiceDirectory"></param> /// <param name="lastModifiedArchive"></param> /// <param name="CurrentSrcMLArchive"></param> /// <returns></returns> public static SolutionMonitor CreateMonitor(string SrcMLServiceDirectory, AbstractArchive lastModifiedArchive, params AbstractArchive[] CurrentSrcMLArchive) { var openSolution = GetOpenSolution(); return(CreateMonitor(openSolution, SrcMLServiceDirectory, lastModifiedArchive, CurrentSrcMLArchive)); }
/// <summary> /// Create an instance of solution monitor. /// </summary> /// <param name="openSolution"></param> /// <param name="SrcMLServiceDirectory"></param> /// <param name="lastModifiedArchive"></param> /// <param name="CurrentSrcMLArchive"></param> /// <returns></returns> private static SolutionMonitor CreateMonitor(Solution openSolution, string SrcMLServiceDirectory, AbstractArchive lastModifiedArchive, params AbstractArchive[] CurrentSrcMLArchive) { Contract.Requires(openSolution != null, "A solution must be open"); var currentMonitor = new SolutionMonitor(SolutionWrapper.Create(openSolution), SrcMLServiceDirectory, lastModifiedArchive, CurrentSrcMLArchive); return currentMonitor; }
/// <summary> /// Create an instance of solution monitor. /// </summary> /// <param name="SrcMLServiceDirectory"></param> /// <param name="lastModifiedArchive"></param> /// <param name="CurrentSrcMLArchive"></param> /// <returns></returns> public static SolutionMonitor CreateMonitor(string SrcMLServiceDirectory, AbstractArchive lastModifiedArchive, params AbstractArchive[] CurrentSrcMLArchive) { var openSolution = GetOpenSolution(); return CreateMonitor(openSolution, SrcMLServiceDirectory, lastModifiedArchive, CurrentSrcMLArchive); }
/// <summary> /// Creates a new source monitor /// </summary> /// <param name="solution">The solution to monitor</param> /// <param name="foldersToMonitor">A list of folders to monitor</param> /// <param name="scanInterval">The interval at which to scan the folders (in /// seconds) </param> /// <param name="baseDirectory">The base directory for this monitor</param> /// <param name="defaultArchive">The default archive to route files to</param> /// <param name="otherArchives">Other archives to route files to</param> public SourceMonitor(Solution solution, double scanInterval, TaskScheduler scheduler, string baseDirectory, AbstractArchive defaultArchive, SrcMLArchive sourceArchive, params AbstractArchive[] otherArchives) : base(DirectoryScanningMonitor.MONITOR_LIST_FILENAME, scanInterval, scheduler, baseDirectory, defaultArchive, otherArchives) { if (null != sourceArchive) { RegisterArchive(sourceArchive, false); } this.MonitoredSolution = solution; }