WebClient.OnUploadFileCompleted(UploadFileCompletedEventArgs) WebClient.OnUploadFileCompleted(UploadFileCompletedEventArgs) WebClient.OnUploadFileCompleted(UploadFileCompletedEventArgs) WebClient.OnUploadFileCompleted(UploadFileCompletedEventArgs) Method

Definizione

Genera l'evento UploadFileCompleted.Raises the UploadFileCompleted event.

protected:
 virtual void OnUploadFileCompleted(System::Net::UploadFileCompletedEventArgs ^ e);
protected virtual void OnUploadFileCompleted (System.Net.UploadFileCompletedEventArgs e);
abstract member OnUploadFileCompleted : System.Net.UploadFileCompletedEventArgs -> unit
override this.OnUploadFileCompleted : System.Net.UploadFileCompletedEventArgs -> unit
Protected Overridable Sub OnUploadFileCompleted (e As UploadFileCompletedEventArgs)

Parametri

Esempi

Esempio di codice seguente viene illustrata un'implementazione di questo metodo che può essere personalizzato da una classe derivata da WebClient.The following code example shows an implementation of this method that can be customized by a class derived from WebClient.

virtual void OnUploadFileCompleted( UploadFileCompletedEventArgs ^ e ) override
{
   // Here you can perform any custom actions before the event is raised
   // and event handlers are called...
   WebClient::OnUploadFileCompleted( e );

   // Here you can perform any post event actions...
}
protected override void OnUploadFileCompleted (UploadFileCompletedEventArgs e)
{
    // Here you can perform any custom actions before the event is raised
    // and event handlers are called...

    base.OnUploadFileCompleted (e);

    // Here you can perform any post event actions...
}

Commenti

Le classi che ereditano da questa classe possono eseguire l'override di questo metodo per eseguire altre attività quando il UploadFileCompleted evento si verifica.Classes that inherit from this class can override this method to perform additional tasks when the UploadFileCompleted event occurs.

Quando viene generato un evento, il gestore dell'evento viene richiamato tramite un delegato.Raising an event invokes the event handler through a delegate. Per altre informazioni, vedere la gestione e generazione di eventi.For more information, see Handling and Raising Events.

Il metodo OnUploadFileCompleted consente inoltre alle classi derivate di gestire l'evento senza associare un delegato.The OnUploadFileCompleted method also allows derived classes to handle the event without attaching a delegate. È la tecnica consigliata per la gestione dell'evento in una classe derivata.This is the preferred technique for handling the event in a derived class.

Note per gli eredi

Quando si esegue l'override OnUploadFileCompleted(UploadFileCompletedEventArgs) in una classe derivata, accertarsi di chiamare la classe di base OnUploadFileCompleted(UploadFileCompletedEventArgs) metodo in modo che i delegati registrati ricevano l'evento.When overriding OnUploadFileCompleted(UploadFileCompletedEventArgs) in a derived class, be sure to call the base class' OnUploadFileCompleted(UploadFileCompletedEventArgs) method so that registered delegates receive the event.

Si applica a