Aracılığıyla paylaş


WebClient.OnDownloadDataCompleted(DownloadDataCompletedEventArgs) Yöntem

Tanım

Olayı tetikler DownloadDataCompleted .

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

Parametreler

e
DownloadDataCompletedEventArgs

DownloadDataCompletedEventArgs Olay verilerini içeren bir nesne.

Örnekler

Aşağıdaki kod örneği, bu yöntemin uygulamasından WebClienttüretilen bir sınıf tarafından özelleştirilebilen bir uygulamasını gösterir.

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

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

    base.OnDownloadDataCompleted(e);

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

Açıklamalar

Bu sınıftan devralan sınıflar, olay gerçekleştiğinde DownloadDataCompleted ek görevler gerçekleştirmek için bu yöntemi geçersiz kılabilir.

Olay bildirmek, bir temsilci yoluyla olay işleyicisini çağırır. Daha fazla bilgi için bkz. Olayları İşleme ve Oluşturma.

yöntemi, OnDownloadDataCompleted türetilmiş sınıfların bir temsilci eklemeden olayı işlemesine de izin verir. Bu, türetilmiş bir sınıftaki olayı işlemek için tercih edilen tekniktir.

Devralanlara Notlar

Türetilmiş bir sınıfta geçersiz kılma OnDownloadDataCompleted(DownloadDataCompletedEventArgs) sırasında, kayıtlı temsilcilerin olayı alması için temel sınıfın OnDownloadDataCompleted(DownloadDataCompletedEventArgs) yöntemini çağırdığınızdan emin olun.

Şunlara uygulanır