Esempio n. 1
0
        public static CaptureSession Start([NotNull] FeedBuilder feedBuilder)
        {
            #region Sanity checks
            if (feedBuilder == null)
            {
                throw new ArgumentNullException("feedBuilder");
            }
            #endregion

            return(new CaptureSession(Snapshot.Take(), feedBuilder));
        }
Esempio n. 2
0
        /// <summary>
        /// Collects data from the locations indicated by the differences between the <see cref="Start"/> state and the current system state.
        /// </summary>
        /// <param name="handler">A callback object used when the the user needs to be informed about IO tasks.</param>
        /// <exception cref="InvalidOperationException">No installation directory was detected.</exception>
        /// <exception cref="OperationCanceledException">The user canceled the operation.</exception>
        /// <exception cref="IOException">There was an error accessing the registry or file system.</exception>
        /// <exception cref="UnauthorizedAccessException">Access to the registry or file system was not permitted.</exception>
        public void Diff([NotNull] ITaskHandler handler)
        {
            #region Sanity checks
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }
            #endregion

            _diff = new SnapshotDiff(before: _snapshot, after: Snapshot.Take());
            if (string.IsNullOrEmpty(InstallationDir))
            {
                InstallationDir = _diff.GetInstallationDir();
            }

            _feedBuilder.ImplementationDirectory = InstallationDir;
            _feedBuilder.DetectCandidates(handler);
        }