protected override void ProcessRecord()
        {
            base.ProcessRecord();
            try
            {
                var sourcesToDestination = MapSourceToDestination(GetFiles());
                var signer = new SigningService(Credential.UserName, Credential.Password.ToUnsecureString(),
                                        sourcesToDestination, ServiceUrl,
                                        MessageHandler, ProgressHandler);
                signer.Sign(StrongName);
            }
            catch (AggregateException ae)
            {

                this.WriteErrorsAndThrowOnLast(
                    ae.Flatten().InnerExceptions.Select(LazyCreateError));
            }
            catch (Exception e)
            {
                ThrowTerminatingError(LazyCreateError(e));
            }
        }
Exemplo n.º 2
0
        public override bool Execute()
        {
            try
            {
                //can we run Execute twice? I don't know so we'll say reset the CTS here
                _source = new CancellationTokenSource();

                SetCredentials();
                var sourcesToDestination = MapSourcesToDestination().ToArray();
                Log.LogMessage(sourcesToDestination.First().Destination.FullName);

                var signer = new SigningService(UserName, Password,
                                        sourcesToDestination, ServiceUrl,
                                        MessageHandler, ProgressHandler);
                signer.Sign(StrongName, _source);

            }
            catch (Exception e)
            {
                Log.LogErrorFromException(e, true, true, null);
            }

            return !Log.HasLoggedErrors;
        }