コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Watchdog.cs プロジェクト: pangsen/SharpRemote
 /// <summary>
 ///     Initializes this object.
 /// </summary>
 /// <param name="internalWatchdog"></param>
 public Watchdog(IInternalWatchdog internalWatchdog)
 {
     _internalWatchdog = internalWatchdog;
 }