Example #1
0
 private void _DoScan(IScanCallback scanCallback)
 {
     if (!m_alreadyReported)
     {
         scanCallback.ReportApplicableUpdate(m_update);
         m_alreadyReported = true;
     }
 } // end _DoScan()
Example #2
0
        } // end constructor

        public async Task ScanAsync(IScanCallback scanCallback)
        {
            // Note that we only allow ClusterUpdateExceptions out; the CAU cmdlet will
            // not handle other exception types, so if any other exception type flies out
            // of here, it will cause an abnormal termination of the CAU cmdlet. (with the
            // exception of OperationCanceledException)
            try
            {
                await Task.Factory.StartNew(() => _DoScan( scanCallback ), m_cancelToken);
            }
            catch (FabrikamException fe)
            {
                throw new ClusterUpdateException(String.Format(CultureInfo.CurrentCulture,
                                                               "Scanning node \"{0}\" failed: {1}",
                                                               m_machine,
                                                               fe.Message),
                                                 "ScanFailed",
                                                 ErrorCategory.NotSpecified,
                                                 fe);
            }
        } // end ScanAsync()
 private void _DoScan( IScanCallback scanCallback )
 {
     if( !m_alreadyReported )
     {
         scanCallback.ReportApplicableUpdate( m_update );
         m_alreadyReported = true;
     }
 } // end _DoScan()
        } // end constructor


        public async Task ScanAsync( IScanCallback scanCallback )
        {
            // Note that we only allow ClusterUpdateExceptions out; the CAU cmdlet will
            // not handle other exception types, so if any other exception type flies out
            // of here, it will cause an abnormal termination of the CAU cmdlet. (with the
            // exception of OperationCanceledException)
            try
            {
                await Task.Factory.StartNew( () => _DoScan( scanCallback ), m_cancelToken );
            }
            catch( FabrikamException fe )
            {
                throw new ClusterUpdateException( String.Format( CultureInfo.CurrentCulture,
                                                                 "Scanning node \"{0}\" failed: {1}",
                                                                 m_machine,
                                                                 fe.Message ),
                                                  "ScanFailed",
                                                  ErrorCategory.NotSpecified,
                                                  fe );
            }
        } // end ScanAsync()