public ApplicationInstaller(IInternalWatchdog watchdog, ApplicationDescriptor descriptor, Installation installation = Installation.FailOnUpgrade) { if (watchdog == null) { throw new ArgumentNullException(nameof(watchdog)); } if (descriptor == null) { throw new ArgumentNullException(nameof(descriptor)); } if (descriptor.Name == null) { throw new ArgumentNullException("descriptor.Name"); } _blockBuffer = new byte[BlockSize]; _descriptor = descriptor; _installation = installation; _watchdog = watchdog; _pendingFiles = new ConcurrentBag <File>(); _cancellationTokenSource = new CancellationTokenSource(); _commitTokenSource = new CancellationTokenSource(); _task = Task.Factory.StartNew(InstallApplication); _watchdog.StartInstallation(descriptor, installation); }
/// <summary> /// Initializes this object. /// </summary> /// <param name="internalWatchdog"></param> public Watchdog(IInternalWatchdog internalWatchdog) { _internalWatchdog = internalWatchdog; }